public void remove(K key) { boolean exists = innerCache.containsKey(key); innerCache.remove(key); if (exists) { getBroadcaster().announce(syncEntity, Broadcaster.Event.DROP.getType(), key.toString()); } }
private static void updateMeta(KylinConfig config) { String[] nodes = config.getRestServers(); for (String node : nodes) { RestClient restClient = new RestClient(node); try { logger.info("update meta cache for " + node); restClient.wipeCache(Broadcaster.SYNC_ALL, Broadcaster.Event.UPDATE.getType(), Broadcaster.SYNC_ALL); } catch (IOException e) { logger.error(e.getMessage()); } } }
public void put(K key, V value) { boolean exists = innerCache.containsKey(key); innerCache.put(key, value); if (!exists) { getBroadcaster().announce(syncEntity, Broadcaster.Event.CREATE.getType(), key.toString()); } else { getBroadcaster().announce(syncEntity, Broadcaster.Event.UPDATE.getType(), key.toString()); } }
public void remove(K key) { boolean exists = innerCache.containsKey(key); innerCache.remove(key); if (exists) { getBroadcaster().announce(syncEntity, Broadcaster.Event.DROP.getType(), key.toString()); } }
public void put(K key, V value) { boolean exists = innerCache.containsKey(key); innerCache.put(key, value); if (!exists) { getBroadcaster().announce(syncEntity, Broadcaster.Event.CREATE.getType(), key.toString()); } else { getBroadcaster().announce(syncEntity, Broadcaster.Event.UPDATE.getType(), key.toString()); } }
private static void updateMeta(KylinConfig config) { String[] nodes = config.getRestServers(); for (String node : nodes) { RestClient restClient = new RestClient(node); try { logger.info("update meta cache for " + node); restClient.wipeCache(Broadcaster.SYNC_ALL, Broadcaster.Event.UPDATE.getType(), Broadcaster.SYNC_ALL); } catch (IOException e) { logger.error(e.getMessage()); } } }
public static Event getEvent(String event) { for (Event one : values()) { if (one.getType().equalsIgnoreCase(event)) { return one; } } return null; } }
public static Event getEvent(String event) { for (Event one : values()) { if (one.getType().equalsIgnoreCase(event)) { return one; } } return null; } }