答案 0 :(得分:4)
这将是一个无限循环的例子
X[ X[, .I[seq_len(which.max(y<0)-1L)], by = x]$V1 ]
这将是你的关机钩。
public void run() {
try {
consumer.subscribe(topics);
while (true) {
ConsumerRecords<String, String> records = consumer.poll(Long.MAX_VALUE);
//do something
}
} catch (WakeupException e) {
// do nothing we are shutting down
} finally {
consumer.close();
}
}
public void shutdown() {
consumer.wakeup();
}
}