backtype.storm.utils.Utils.loadClojureFn()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(8.5k)|赞(0)|评价(0)|浏览(123)

本文整理了Java中backtype.storm.utils.Utils.loadClojureFn()方法的一些代码示例,展示了Utils.loadClojureFn()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.loadClojureFn()方法的具体详情如下:
包路径:backtype.storm.utils.Utils
类名称:Utils
方法名:loadClojureFn

Utils.loadClojureFn介绍

暂无

代码示例

代码示例来源:origin: alibaba/jstorm

@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);
  }
}

代码示例来源:origin: alibaba/jstorm

@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);
    }
  }
}

代码示例来源:origin: alibaba/mdrill

@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);
    }
  }
}

代码示例来源:origin: alibaba/mdrill

@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);
    }
  }    
}

代码示例来源:origin: alibaba/jstorm

@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);
  }
}

代码示例来源:origin: alibaba/jstorm

@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);
  }
}

代码示例来源:origin: alibaba/mdrill

@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);
  }
}

代码示例来源:origin: alibaba/mdrill

@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);
  }
}

代码示例来源:origin: com.n3twork.storm/storm-core

@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);
    }
  }
}

代码示例来源:origin: com.alibaba.jstorm/jstorm-core

@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);
  }
}

代码示例来源:origin: com.n3twork.storm/storm-core

@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);
  }
}

代码示例来源:origin: com.alibaba.jstorm/jstorm-core

@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);
    }
  }
}

代码示例来源:origin: com.alibaba.jstorm/jstorm-core

@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);
  }
}

代码示例来源:origin: com.n3twork.storm/storm-core

@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);
  }
}

代码示例来源:origin: com.n3twork.storm/storm-core

@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);
  }
}

代码示例来源:origin: com.alibaba.jstorm/jstorm-core

@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);
  }
}

相关文章