本文整理汇总了Java中org.elasticsearch.river.River类的典型用法代码示例。如果您正苦于以下问题:Java River类的具体用法?Java River怎么用?Java River使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
River类属于org.elasticsearch.river包,在下文中一共展示了River类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: masterOperation
import org.elasticsearch.river.River; //导入依赖的package包/类
@Override
protected void masterOperation(GetRiverStateRequest request, ClusterState state, ActionListener<GetRiverStateResponse> listener) throws ElasticsearchException {
MetaData metaData = state.metaData();
RiverStatesMetaData riverStates = metaData.custom(RiverStatesMetaData.TYPE);
if (request.getRiverName() == null || request.getRiverType() == null) {
listener.onResponse(new GetRiverStateResponse(request, riverStates.rivers()));
} else {
String riverName = request.getRiverName();
String riverType = request.getRiverType();
ImmutableList.Builder<RiverState> builder = ImmutableList.builder();
for (Map.Entry<RiverName, River> entry : RiverHelper.rivers(injector).entrySet()) {
RiverName name = entry.getKey();
if (("*".equals(riverName) || name.getName().equals(riverName)) && ("*".equals(riverType) || name.getType().equals(riverType)) && entry.getValue() instanceof StatefulRiver) {
StatefulRiver river = (StatefulRiver) entry.getValue();
if (river.getRiverState() != null) {
builder.add(river.getRiverState());
}
}
}
listener.onResponse(new GetRiverStateResponse(request, builder.build()));
}
}
示例2: nodeOperation
import org.elasticsearch.river.River; //导入依赖的package包/类
@Override
protected NodeRiverExecuteResponse nodeOperation(NodeRiverExecuteRequest request) throws ElasticsearchException {
NodeInfo nodeInfo = nodeService.info(false, true, false, true, false, false, true, false, true);
String riverType = request.getRiverType();
String riverName = request.getRiverName();
for (Map.Entry<RiverName, River> entry : RiverHelper.rivers(injector).entrySet()) {
RiverName name = entry.getKey();
if ((riverName == null || name.getName().equals(riverName))
&& (riverType == null || name.getType().equals(riverType))
&& entry.getValue() instanceof RunnableRiver) {
RunnableRiver river = (RunnableRiver) entry.getValue();
river.run();
return new NodeRiverExecuteResponse(nodeInfo.getNode()).setExecuted(true);
}
}
return new NodeRiverExecuteResponse(nodeInfo.getNode()).setExecuted(false);
}
示例3: rivers
import org.elasticsearch.river.River; //导入依赖的package包/类
/**
* Retrieve the registered rivers using reflection. This hack can be removed when RiversService gets a public API.
*
* @param injector injector
* @return map of rivers or null if not possible
*/
@SuppressWarnings({"unchecked"})
public static ImmutableMap<RiverName, River> rivers(Injector injector) {
RiversService riversService = injector.getInstance(RiversService.class);
try {
Field field = RiversService.class.getDeclaredField("rivers");
if (field != null) {
field.setAccessible(true);
return (ImmutableMap<RiverName, River>) field.get(riversService);
}
} catch (Throwable e) {
//
}
return ImmutableMap.of();
}
示例4: configure
import org.elasticsearch.river.River; //导入依赖的package包/类
@Override
protected void configure() {
bind(River.class).to(DynamoDbRiver.class).asEagerSingleton();
}
示例5: configure
import org.elasticsearch.river.River; //导入依赖的package包/类
@Override
protected void configure() {
bind(River.class).to(SnapshotsRiver.class).asEagerSingleton();
}
示例6: configure
import org.elasticsearch.river.River; //导入依赖的package包/类
@Override
protected void configure() {
bind(River.class).to(BigQueryRiver.class).asEagerSingleton();
}
示例7: configure
import org.elasticsearch.river.River; //导入依赖的package包/类
@Override
protected void configure() {
bind(River.class).to(ZookeeperRiver.class).asEagerSingleton();
}
示例8: configure
import org.elasticsearch.river.River; //导入依赖的package包/类
@Override
protected void configure() {
bind(River.class).to(TMDBRiver.class).asEagerSingleton();
}
示例9: configure
import org.elasticsearch.river.River; //导入依赖的package包/类
@Override
protected void configure() {
bind(River.class).to(GitHubRiver.class).asEagerSingleton();
}
示例10: configure
import org.elasticsearch.river.River; //导入依赖的package包/类
@Override
protected void configure() {
bind(River.class).to(NvdRiver.class).asEagerSingleton();
}
示例11: configure
import org.elasticsearch.river.River; //导入依赖的package包/类
@Override
protected void configure()
{
bind(River.class).to(CoherenceRiver.class).asEagerSingleton();
}
示例12: configure
import org.elasticsearch.river.River; //导入依赖的package包/类
@Override
protected void configure() {
bind(River.class).to(JDBCRiver.class).asEagerSingleton();
}
示例13: configure
import org.elasticsearch.river.River; //导入依赖的package包/类
@Override
protected void configure() {
bind(River.class).to(KafkaRiver.class).asEagerSingleton();
}
示例14: configure
import org.elasticsearch.river.River; //导入依赖的package包/类
@Override
protected void configure() {
bind(River.class).to(HBaseRiver.class).asEagerSingleton();
}
示例15: configure
import org.elasticsearch.river.River; //导入依赖的package包/类
@Override
protected void configure() {
bind(River.class).to(Neo4jDriver.class).asEagerSingleton();
}