@Override public Map<String, Object> getComponentConfiguration() { IFn hof = Utils.loadClojureFn(_confSpec.get(0), _confSpec.get(1)); try { return (Map) hof.applyTo(RT.seq(_params)); } catch (Exception e) { throw new RuntimeException(e); } }
@Override public Map<String, Object> getComponentConfiguration() { IFn hof = Utils.loadClojureFn(_confSpec.get(0), _confSpec.get(1)); try { return (Map) hof.applyTo(RT.seq(_params)); } catch (Exception e) { throw new RuntimeException(e); } } }
public static void main(String[] args) { REQUIRE.invoke(CLOJURE_MAIN); MAIN.applyTo(RT.seq(args)); } }
public static void legacy_repl(String[] args) { REQUIRE.invoke(CLOJURE_MAIN); LEGACY_REPL.invoke(RT.seq(args)); }
public static void legacy_script(String[] args) { REQUIRE.invoke(CLOJURE_MAIN); LEGACY_SCRIPT.invoke(RT.seq(args)); }
@Override public Map<String, Object> getComponentConfiguration() { IFn hof = Utils.loadClojureFn(_confSpec.get(0), _confSpec.get(1)); try { return (Map) hof.applyTo(RT.seq(_params)); } catch (Exception e) { throw new RuntimeException(e); } } }
@Override public Map<String, Object> getComponentConfiguration() { IFn hof = Utils.loadClojureFn(_confSpec.get(0), _confSpec.get(1)); try { return (Map) hof.applyTo(RT.seq(_params)); } catch (Exception e) { throw new RuntimeException(e); } } }
public static void main (String[] args) throws Exception { RT.var("clojure.core", "require").invoke(Symbol.intern("clojure.tools.nrepl.cmdline")); RT.var("clojure.tools.nrepl.cmdline", "-main").applyTo(RT.seq(args)); } }
@SuppressWarnings("unchecked") @Override public void prepare(final Map stormConf, final TopologyContext context, final OutputCollector collector) { IFn hof = Utils.loadClojureFn(_fnSpec.get(0), _fnSpec.get(1)); try { IFn preparer = (IFn) hof.applyTo(RT.seq(_params)); final Map<Keyword, Object> collectorMap = new PersistentArrayMap(new Object[]{Keyword.intern(Symbol.create("output-collector")), collector, Keyword.intern(Symbol.create("context")), context}); List<Object> args = new ArrayList<Object>() { { add(stormConf); add(context); add(collectorMap); } }; _bolt = (IBolt) preparer.applyTo(RT.seq(args)); // this is kind of unnecessary for clojure try { _bolt.prepare(stormConf, context, collector); } catch (AbstractMethodError ignored) { } } catch (Exception e) { throw new RuntimeException(e); } }
@SuppressWarnings("unchecked") @Override public void open(final Map conf, final TopologyContext context, final SpoutOutputCollector collector) { IFn hof = Utils.loadClojureFn(_fnSpec.get(0), _fnSpec.get(1)); try { IFn preparer = (IFn) hof.applyTo(RT.seq(_params)); final Map<Keyword, Object> collectorMap = new PersistentArrayMap(new Object[]{Keyword.intern(Symbol.create("output-collector")), collector, Keyword.intern(Symbol.create("context")), context}); List<Object> args = new ArrayList<Object>() { { add(conf); add(context); add(collectorMap); } }; _spout = (ISpout) preparer.applyTo(RT.seq(args)); // this is kind of unnecessary for clojure try { _spout.open(conf, context, collector); } catch (AbstractMethodError ignored) { } } catch (Exception e) { throw new RuntimeException(e); } }
@Override public void prepare(final Map stormConf, final TopologyContext context, final OutputCollector collector) { IFn hof = Utils.loadClojureFn(_fnSpec.get(0), _fnSpec.get(1)); try { IFn preparer = (IFn) hof.applyTo(RT.seq(_params)); final Map<Keyword,Object> collectorMap = new PersistentArrayMap( new Object[] { Keyword.intern(Symbol.create("output-collector")), collector, Keyword.intern(Symbol.create("context")), context}); List<Object> args = new ArrayList<Object>() {{ add(stormConf); add(context); add(collectorMap); }}; _bolt = (IBolt) preparer.applyTo(RT.seq(args)); //this is kind of unnecessary for clojure try { _bolt.prepare(stormConf, context, collector); } catch(AbstractMethodError ame) { } } catch (Exception e) { throw new RuntimeException(e); } }
@Override public void open(final Map conf, final TopologyContext context, final SpoutOutputCollector collector) { IFn hof = Utils.loadClojureFn(_fnSpec.get(0), _fnSpec.get(1)); try { IFn preparer = (IFn) hof.applyTo(RT.seq(_params)); final Map<Keyword,Object> collectorMap = new PersistentArrayMap( new Object[] { Keyword.intern(Symbol.create("output-collector")), collector, Keyword.intern(Symbol.create("context")), context}); List<Object> args = new ArrayList<Object>() {{ add(conf); add(context); add(collectorMap); }}; _spout = (ISpout) preparer.applyTo(RT.seq(args)); //this is kind of unnecessary for clojure try { _spout.open(conf, context, collector); } catch(AbstractMethodError ame) { } } catch (Exception e) { throw new RuntimeException(e); } }
static public ISeq more(Object x){ if(x instanceof ISeq) return ((ISeq) x).more(); ISeq seq = seq(x); if(seq == null) return PersistentList.EMPTY; return seq.more(); }
public boolean equals(Object o){ ISeq s = seq(); if(s != null) return s.equals(o); else return (o instanceof Sequential || o instanceof List) && RT.seq(o) == null; }
@Override public Map<String, Object> getComponentConfiguration() { IFn hof = Utils.loadClojureFn(_confSpec.get(0), _confSpec.get(1)); try { return (Map) hof.applyTo(RT.seq(_params)); } catch (Exception e) { throw new RuntimeException(e); } } }
@Override public Map<String, Object> getComponentConfiguration() { IFn hof = Utils.loadClojureFn(_confSpec.get(0), _confSpec.get(1)); try { return (Map) hof.applyTo(RT.seq(_params)); } catch (Exception e) { throw new RuntimeException(e); } }
public boolean equiv(Object o){ ISeq s = seq(); if(s != null) return s.equiv(o); else return (o instanceof Sequential || o instanceof List) && RT.seq(o) == null; }
public static void main(String[] args) { Symbol CLOJURE_MAIN = Symbol.intern("clojure.main"); Var REQUIRE = RT.var("clojure.core", "require"); Var MAIN = RT.var("clojure.main", "main"); try { REQUIRE.invoke(CLOJURE_MAIN); MAIN.applyTo(RT.seq(new String[]{})); } catch(Exception e) { e.printStackTrace(); } } }
public boolean equiv(Object obj){ if(!(obj instanceof Sequential || obj instanceof List)) return false; ISeq ms = RT.seq(obj); for(ISeq s = seq(); s != null; s = s.next(), ms = ms.next()) { if(ms == null || !Util.equiv(s.first(), ms.first())) return false; } return ms == null; }
public boolean equals(Object obj){ if(this == obj) return true; if(!(obj instanceof Sequential || obj instanceof List)) return false; ISeq ms = RT.seq(obj); for(ISeq s = seq(); s != null; s = s.next(), ms = ms.next()) { if(ms == null || !Util.equals(s.first(), ms.first())) return false; } return ms == null; }