@Deprecated private void addObserver(ObserverSpecification oconf, int next) { Map<String, String> params = oconf.getConfiguration().toMap(); StringBuilder paramString = new StringBuilder(); for (java.util.Map.Entry<String, String> pentry : params.entrySet()) { paramString.append(','); paramString.append(pentry.getKey()); paramString.append('='); paramString.append(pentry.getValue()); } setProperty(OBSERVER_PREFIX + "" + next, oconf.getClassName() + paramString); }
@Deprecated private void addObserver(ObserverSpecification oconf, int next) { Map<String, String> params = oconf.getConfiguration().toMap(); StringBuilder paramString = new StringBuilder(); for (java.util.Map.Entry<String, String> pentry : params.entrySet()) { paramString.append(','); paramString.append(pentry.getKey()); paramString.append('='); paramString.append(pentry.getValue()); } setProperty(OBSERVER_PREFIX + "" + next, oconf.getClassName() + paramString); }
private static void serializeObservers(DataOutputStream dos, Map<Column, org.apache.fluo.api.config.ObserverSpecification> colObservers) throws IOException { // TODO use a human readable serialized format like json Set<Entry<Column, org.apache.fluo.api.config.ObserverSpecification>> es = colObservers.entrySet(); WritableUtils.writeVInt(dos, colObservers.size()); for (Entry<Column, org.apache.fluo.api.config.ObserverSpecification> entry : es) { ColumnUtil.writeColumn(entry.getKey(), dos); dos.writeUTF(entry.getValue().getClassName()); Map<String, String> params = entry.getValue().getConfiguration().toMap(); WritableUtils.writeVInt(dos, params.size()); for (Entry<String, String> pentry : params.entrySet()) { dos.writeUTF(pentry.getKey()); dos.writeUTF(pentry.getValue()); } } }
private static void serializeObservers(DataOutputStream dos, Map<Column, org.apache.fluo.api.config.ObserverSpecification> colObservers) throws IOException { // TODO use a human readable serialized format like json Set<Entry<Column, org.apache.fluo.api.config.ObserverSpecification>> es = colObservers.entrySet(); WritableUtils.writeVInt(dos, colObservers.size()); for (Entry<Column, org.apache.fluo.api.config.ObserverSpecification> entry : es) { ColumnUtil.writeColumn(entry.getKey(), dos); dos.writeUTF(entry.getValue().getClassName()); Map<String, String> params = entry.getValue().getConfiguration().toMap(); WritableUtils.writeVInt(dos, params.size()); for (Entry<String, String> pentry : params.entrySet()) { dos.writeUTF(pentry.getKey()); dos.writeUTF(pentry.getValue()); } } }
observer = Class.forName(observerConfig.getClassName()).asSubclass(Observer.class).newInstance(); observer.init(new ObserverContext(env, observerConfig.getConfiguration())); } catch (RuntimeException e) { throw e;
observer = Class.forName(observerConfig.getClassName()).asSubclass(Observer.class).newInstance(); observer.init(new ObserverContext(env, observerConfig.getConfiguration())); } catch (RuntimeException e) { throw e;
SimpleConfiguration oc = ospec.getConfiguration(); logger.info("Setting up observer {} using params {}.", observer.getClass().getSimpleName(), oc.toMap());
SimpleConfiguration oc = ospec.getConfiguration(); logger.info("Setting up observer {} using params {}.", observer.getClass().getSimpleName(), oc.toMap());