本文整理汇总了Java中clojure.lang.RT类的典型用法代码示例。如果您正苦于以下问题:Java RT类的具体用法?Java RT怎么用?Java RT使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RT类属于clojure.lang包,在下文中一共展示了RT类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: init
import clojure.lang.RT; //导入依赖的package包/类
private void init() {
loader = new DynamicClassLoaderSimple(ClassLoader.getSystemClassLoader());
loader.addJars(classPath);
loader.addDynamicDir(outDir);
String loadFunctionPrefix = "run_str";
currenClojureNS = String.format("%1$s_%2$s", beaker_clojure_ns, shellId);
try {
String clojureInitScript = String.format(initScriptSource(), beaker_clojure_ns, shellId,
loadFunctionPrefix);
clojureLoadString = RT.var(String.format("%1$s_%2$s", beaker_clojure_ns, shellId),
String.format("%1$s_%2$s", loadFunctionPrefix, shellId));
clojure.lang.Compiler.load(new StringReader(clojureInitScript));
} catch (IOException e) {
logger.error(e.getMessage());
}
exit = false;
executor = new BeakerCellExecutor("clojure");
}
开发者ID:twosigma,项目名称:beaker-notebook-archive,代码行数:22,代码来源:ClojureEvaluator.java
示例2: traverseFrom
import clojure.lang.RT; //导入依赖的package包/类
ISeq traverseFrom(final Object lbound, Winner winner) {
if (null == winner)
return PersistentList.EMPTY;
final Match match = unplay(winner);
if (null == match.right) {
Object lkey = match.left.key;
if (kcomp.compare(lbound, lkey) <= 0)
return RT.list(new MapEntry(lkey, match.left.priority));
return PersistentList.EMPTY;
}
final Object lubound = match.left.ubound;
return concat(
new LazySeq(new AFn() {
public ISeq invoke() {
return kcomp.compare(lbound, lubound) <= 0 ?
traverseFrom(lbound, match.left) :
null;
}
}),
new LazySeq(new AFn() {
public ISeq invoke() {
return traverseFrom(lbound, match.right);
}
})
);
}
开发者ID:michalmarczyk,项目名称:psq.clj,代码行数:27,代码来源:PersistentPrioritySearchQueue.java
示例3: rtraverseFrom
import clojure.lang.RT; //导入依赖的package包/类
ISeq rtraverseFrom(final Object ubound, Winner winner) {
if (null == winner)
return PersistentList.EMPTY;
final Match match = unplay(winner);
if (null == match.right) {
Object lkey = match.left.key;
if (kcomp.compare(lkey, ubound) <= 0)
return RT.list(new MapEntry(lkey, match.left.priority));
return PersistentList.EMPTY;
}
final Object lubound = match.left.ubound;
return concat(
new LazySeq(new AFn() {
public ISeq invoke() {
return kcomp.compare(lubound, ubound) <= 0 ?
rtraverseFrom(ubound, match.right) :
null;
}
}),
new LazySeq(new AFn() {
public ISeq invoke() {
return rtraverseFrom(ubound, match.left);
}
})
);
}
开发者ID:michalmarczyk,项目名称:psq.clj,代码行数:27,代码来源:PersistentPrioritySearchQueue.java
示例4: traverseAtMost
import clojure.lang.RT; //导入依赖的package包/类
ISeq traverseAtMost(final Object priority, final Winner winner) {
if (null == winner || pcomp.compare(winner.priority, priority) > 0)
return PersistentList.EMPTY;
final Match match = unplay(winner);
if (null == match.right)
return RT.list(new MapEntry(match.left.key, match.left.priority));
return concat(
new LazySeq(new AFn() {
public ISeq invoke() {
return traverseAtMost(priority, match.left);
}
}),
new LazySeq(new AFn() {
public ISeq invoke() {
return traverseAtMost(priority, match.right);
}
})
);
}
开发者ID:michalmarczyk,项目名称:psq.clj,代码行数:20,代码来源:PersistentPrioritySearchQueue.java
示例5: traverseBelow
import clojure.lang.RT; //导入依赖的package包/类
ISeq traverseBelow(final Object priority, final Winner winner) {
if (null == winner || pcomp.compare(winner.priority, priority) >= 0)
return PersistentList.EMPTY;
final Match match = unplay(winner);
if (null == match.right)
return RT.list(new MapEntry(match.left.key, match.left.priority));
return concat(
new LazySeq(new AFn() {
public ISeq invoke() {
return traverseBelow(priority, match.left);
}
}),
new LazySeq(new AFn() {
public ISeq invoke() {
return traverseBelow(priority, match.right);
}
})
);
}
开发者ID:michalmarczyk,项目名称:psq.clj,代码行数:20,代码来源:PersistentPrioritySearchQueue.java
示例6: rtraverseAtMost
import clojure.lang.RT; //导入依赖的package包/类
ISeq rtraverseAtMost(final Object priority, Winner winner) {
if (null == winner || pcomp.compare(winner.priority, priority) > 0)
return PersistentList.EMPTY;
final Match match = unplay(winner);
if (null == match.right)
return RT.list(new MapEntry(match.left.key, match.left.priority));
return concat(
new LazySeq(new AFn() {
public ISeq invoke() {
return rtraverseAtMost(priority, match.right);
}
}),
new LazySeq(new AFn() {
public ISeq invoke() {
return rtraverseAtMost(priority, match.left);
}
})
);
}
开发者ID:michalmarczyk,项目名称:psq.clj,代码行数:20,代码来源:PersistentPrioritySearchQueue.java
示例7: rtraverseBelow
import clojure.lang.RT; //导入依赖的package包/类
ISeq rtraverseBelow(final Object priority, Winner winner) {
if (null == winner || pcomp.compare(winner.priority, priority) >= 0)
return PersistentList.EMPTY;
final Match match = unplay(winner);
if (null == match.right)
return RT.list(new MapEntry(match.left.key, match.left.priority));
return concat(
new LazySeq(new AFn() {
public ISeq invoke() {
return rtraverseBelow(priority, match.right);
}
}),
new LazySeq(new AFn() {
public ISeq invoke() {
return rtraverseBelow(priority, match.left);
}
})
);
}
开发者ID:michalmarczyk,项目名称:psq.clj,代码行数:20,代码来源:PersistentPrioritySearchQueue.java
示例8: open
import clojure.lang.RT; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
@Override
public void open(Map stormConf, TopologyContext context,
SpoutOutputCollector collector) {
_collector = collector;
_context = context;
workerTimeoutMills = 1000 * RT.intCast(stormConf.get(Config.SUPERVISOR_WORKER_TIMEOUT_SECS));
_process = new ShellProcess(_command);
Number subpid = _process.launch(stormConf, context);
LOG.info("Launched subprocess with pid " + subpid);
heartBeatExecutorService = MoreExecutors.getExitingScheduledExecutorService(new ScheduledThreadPoolExecutor(1));
}
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:17,代码来源:ShellSpout.java
示例9: prepare
import clojure.lang.RT; //导入依赖的package包/类
@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);
}
}
开发者ID:metamx,项目名称:incubator-storm,代码行数:26,代码来源:ClojureBolt.java
示例10: open
import clojure.lang.RT; //导入依赖的package包/类
@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);
}
}
开发者ID:metamx,项目名称:incubator-storm,代码行数:26,代码来源:ClojureSpout.java
示例11: create
import clojure.lang.RT; //导入依赖的package包/类
static public PersistentPrioritySearchQueue create(ISeq items) {
IPersistentMap ret = EMPTY;
for (; items != null; items = items.next().next()) {
if (items.next() == null)
throw new IllegalArgumentException(
String.format("No value supplied for key: %s", items.first())
);
ret = ret.assoc(items.first(), RT.second(items));
}
return (PersistentPrioritySearchQueue) ret;
}
开发者ID:michalmarczyk,项目名称:psq.clj,代码行数:12,代码来源:PersistentPrioritySearchQueue.java
示例12: traverse
import clojure.lang.RT; //导入依赖的package包/类
ISeq traverse(final Object key, final Object priority, Loser losers) {
if (null == losers)
return RT.list(new MapEntry(key, priority));
final Object lkey = losers.key;
final Object lpriority = losers.priority;
final Loser lleft = losers.left;
final Loser lright = losers.right;
if (kcomp.compare(lkey, losers.split) <= 0)
return concat(
new LazySeq(new AFn() {
public ISeq invoke() {
return traverse(lkey, lpriority, lleft);
}
}),
new LazySeq(new AFn() {
public ISeq invoke() {
return traverse(key, priority, lright);
}
})
);
return concat(
new LazySeq(new AFn() {
public ISeq invoke() {
return traverse(key, priority, lleft);
}
}),
new LazySeq(new AFn() {
public ISeq invoke() {
return traverse(lkey, lpriority, lright);
}
})
);
}
开发者ID:michalmarczyk,项目名称:psq.clj,代码行数:34,代码来源:PersistentPrioritySearchQueue.java
示例13: rtraverse
import clojure.lang.RT; //导入依赖的package包/类
ISeq rtraverse(final Object key, final Object priority, Loser losers) {
if (null == losers)
return RT.list(new MapEntry(key, priority));
final Object lkey = losers.key;
final Object lpriority = losers.priority;
final Loser lleft = losers.left;
final Loser lright = losers.right;
if (kcomp.compare(lkey, losers.split) <= 0)
return concat(
new LazySeq(new AFn() {
public ISeq invoke() {
return rtraverse(key, priority, lright);
}
}),
new LazySeq(new AFn() {
public ISeq invoke() {
return rtraverse(lkey, lpriority, lleft);
}
})
);
return concat(
new LazySeq(new AFn() {
public ISeq invoke() {
return rtraverse(lkey, lpriority, lright);
}
}),
new LazySeq(new AFn() {
public ISeq invoke() {
return rtraverse(key, priority, lleft);
}
})
);
}
开发者ID:michalmarczyk,项目名称:psq.clj,代码行数:34,代码来源:PersistentPrioritySearchQueue.java
示例14: traverseAtMostRange
import clojure.lang.RT; //导入依赖的package包/类
ISeq traverseAtMostRange(final Object low, final Object high, final Object priority, Winner winner) {
if (null == winner || pcomp.compare(winner.priority, priority) > 0)
return PersistentList.EMPTY;
final Match match = unplay(winner);
if (null == match.right) {
Object lkey = match.left.key;
if (kcomp.compare(low, lkey) <= 0 && kcomp.compare(lkey, high) <= 0)
return RT.list(new MapEntry(lkey, match.left.priority));
return PersistentList.EMPTY;
}
final Object lubound = match.left.ubound;
return concat(
new LazySeq(new AFn() {
public ISeq invoke() {
return kcomp.compare(low, lubound) <= 0 ?
traverseAtMostRange(low, high, priority, match.left) :
null;
}
}),
new LazySeq(new AFn() {
public ISeq invoke() {
return kcomp.compare(lubound, high) <= 0 ?
traverseAtMostRange(low, high, priority, match.right) :
null;
}
})
);
}
开发者ID:michalmarczyk,项目名称:psq.clj,代码行数:29,代码来源:PersistentPrioritySearchQueue.java
示例15: traverseBelowRange
import clojure.lang.RT; //导入依赖的package包/类
ISeq traverseBelowRange(final Object low, final Object high, final Object priority, Winner winner) {
if (null == winner || pcomp.compare(winner.priority, priority) >= 0)
return PersistentList.EMPTY;
final Match match = unplay(winner);
if (null == match.right) {
Object lkey = match.left.key;
if (kcomp.compare(low, lkey) <= 0 && kcomp.compare(lkey, high) <= 0)
return RT.list(new MapEntry(lkey, match.left.priority));
return PersistentList.EMPTY;
}
final Object lubound = match.left.ubound;
return concat(
new LazySeq(new AFn() {
public ISeq invoke() {
return kcomp.compare(low, lubound) <= 0 ?
traverseBelowRange(low, high, priority, match.left) :
null;
}
}),
new LazySeq(new AFn() {
public ISeq invoke() {
return kcomp.compare(lubound, high) <= 0 ?
traverseBelowRange(low, high, priority, match.right) :
null;
}
})
);
}
开发者ID:michalmarczyk,项目名称:psq.clj,代码行数:29,代码来源:PersistentPrioritySearchQueue.java
示例16: rtraverseAtMostRange
import clojure.lang.RT; //导入依赖的package包/类
ISeq rtraverseAtMostRange(final Object low, final Object high, final Object priority, Winner winner) {
if (null == winner || pcomp.compare(winner.priority, priority) > 0)
return PersistentList.EMPTY;
final Match match = unplay(winner);
if (null == match.right) {
Object lkey = match.left.key;
if (kcomp.compare(low, lkey) <= 0 && kcomp.compare(lkey, high) <= 0)
return RT.list(new MapEntry(lkey, match.left.priority));
return PersistentList.EMPTY;
}
final Object lubound = match.left.ubound;
return concat(
new LazySeq(new AFn() {
public ISeq invoke() {
return kcomp.compare(lubound, high) <= 0 ?
rtraverseAtMostRange(low, high, priority, match.right) :
null;
}
}),
new LazySeq(new AFn() {
public ISeq invoke() {
return kcomp.compare(low, lubound) <= 0 ?
rtraverseAtMostRange(low, high, priority, match.left) :
null;
}
})
);
}
开发者ID:michalmarczyk,项目名称:psq.clj,代码行数:29,代码来源:PersistentPrioritySearchQueue.java
示例17: rtraverseBelowRange
import clojure.lang.RT; //导入依赖的package包/类
ISeq rtraverseBelowRange(final Object low, final Object high, final Object priority, Winner winner) {
if (null == winner || pcomp.compare(winner.priority, priority) >= 0)
return PersistentList.EMPTY;
final Match match = unplay(winner);
if (null == match.right) {
Object lkey = match.left.key;
if (kcomp.compare(low, lkey) <= 0 && kcomp.compare(lkey, high) <= 0)
return RT.list(new MapEntry(lkey, match.left.priority));
return PersistentList.EMPTY;
}
final Object lubound = match.left.ubound;
return concat(
new LazySeq(new AFn() {
public ISeq invoke() {
return kcomp.compare(lubound, high) <= 0 ?
rtraverseBelowRange(low, high, priority, match.right) :
null;
}
}),
new LazySeq(new AFn() {
public ISeq invoke() {
return kcomp.compare(low, lubound) <= 0 ?
rtraverseBelowRange(low, high, priority, match.left) :
null;
}
})
);
}
开发者ID:michalmarczyk,项目名称:psq.clj,代码行数:29,代码来源:PersistentPrioritySearchQueue.java
示例18: seqFrom
import clojure.lang.RT; //导入依赖的package包/类
public ISeq seqFrom(Object k, boolean ascending) {
if (_count == 0)
return null;
ISeq ret;
if (ascending)
ret = traverseFrom(k, winner);
else
ret = rtraverseFrom(k, winner);
return RT.seq(ret);
}
开发者ID:michalmarczyk,项目名称:psq.clj,代码行数:11,代码来源:PersistentPrioritySearchQueue.java
示例19: loadClojureFn
import clojure.lang.RT; //导入依赖的package包/类
public static IFn loadClojureFn(String namespace, String name) {
try {
clojure.lang.Compiler.eval(RT.readString("(require '" + namespace
+ ")"));
} catch (Exception e) {
// if playing from the repl and defining functions, file won't exist
}
return (IFn) RT.var(namespace, name).deref();
}
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:10,代码来源:Utils.java
示例20: prepare
import clojure.lang.RT; //导入依赖的package包/类
@Override
public void prepare(Map stormConf, TopologyContext context,
final OutputCollector collector) {
Object maxPending = stormConf.get(Config.TOPOLOGY_SHELLBOLT_MAX_PENDING);
if (maxPending != null) {
this._pendingWrites = new LinkedBlockingQueue(((Number)maxPending).intValue());
}
_rand = new Random();
_collector = collector;
_context = context;
workerTimeoutMills = 1000 * RT.intCast(stormConf.get(Config.SUPERVISOR_WORKER_TIMEOUT_SECS));
_process = new ShellProcess(_command);
//subprocesses must send their pid first thing
Number subpid = _process.launch(stormConf, context);
LOG.info("Launched subprocess with pid " + subpid);
// reader
_readerThread = new Thread(new BoltReaderRunnable());
_readerThread.start();
_writerThread = new Thread(new BoltWriterRunnable());
_writerThread.start();
heartBeatExecutorService = MoreExecutors.getExitingScheduledExecutorService(new ScheduledThreadPoolExecutor(1));
heartBeatExecutorService.scheduleAtFixedRate(new BoltHeartbeatTimerTask(this), 1, 1, TimeUnit.SECONDS);
LOG.info("Start checking heartbeat...");
setHeartbeat();
}
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:34,代码来源:ShellBolt.java
注:本文中的clojure.lang.RT类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论