当前位置: 首页>>代码示例>>Java>>正文


Java River类代码示例

本文整理汇总了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()));
    }
}
 
开发者ID:szwork2013,项目名称:elasticsearch-sentiment,代码行数:23,代码来源:TransportGetRiverStateAction.java

示例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);
}
 
开发者ID:szwork2013,项目名称:elasticsearch-sentiment,代码行数:18,代码来源:TransportRiverExecuteAction.java

示例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();
}
 
开发者ID:szwork2013,项目名称:elasticsearch-sentiment,代码行数:21,代码来源:RiverHelper.java

示例4: configure

import org.elasticsearch.river.River; //导入依赖的package包/类
@Override
protected void configure() {
    bind(River.class).to(DynamoDbRiver.class).asEagerSingleton();
}
 
开发者ID:kzwang,项目名称:elasticsearch-river-dynamodb,代码行数:5,代码来源:DynamoDbRiverModule.java

示例5: configure

import org.elasticsearch.river.River; //导入依赖的package包/类
@Override
protected void configure() {
	bind(River.class).to(SnapshotsRiver.class).asEagerSingleton();
}
 
开发者ID:garmin,项目名称:elasticsearch-river-snapshot,代码行数:5,代码来源:SnapshotsRiverModule.java

示例6: configure

import org.elasticsearch.river.River; //导入依赖的package包/类
@Override
protected void configure() {
	bind(River.class).to(BigQueryRiver.class).asEagerSingleton();
}
 
开发者ID:mallocator,项目名称:Elasticsearch-BigQuery-River,代码行数:5,代码来源:BigQueryRiverModule.java

示例7: configure

import org.elasticsearch.river.River; //导入依赖的package包/类
@Override
protected void configure() {
    bind(River.class).to(ZookeeperRiver.class).asEagerSingleton();
}
 
开发者ID:xingxiudong,项目名称:elasticsearch-zkdiscovery,代码行数:5,代码来源:ZookeeperRiverModule.java

示例8: configure

import org.elasticsearch.river.River; //导入依赖的package包/类
@Override
protected void configure() {
	bind(River.class).to(TMDBRiver.class).asEagerSingleton();
}
 
开发者ID:conlini,项目名称:elasticsearch-tmdb-river,代码行数:5,代码来源:TMDBRiverModule.java

示例9: configure

import org.elasticsearch.river.River; //导入依赖的package包/类
@Override
protected void configure() {
    bind(River.class).to(GitHubRiver.class).asEagerSingleton();
}
 
开发者ID:uberVU,项目名称:elasticsearch-river-github,代码行数:5,代码来源:GitHubRiverModule.java

示例10: configure

import org.elasticsearch.river.River; //导入依赖的package包/类
@Override
protected void configure() {
	bind(River.class).to(NvdRiver.class).asEagerSingleton();
}
 
开发者ID:frosenberg,项目名称:elasticsearch-nvd-river,代码行数:5,代码来源:NvdRiverModule.java

示例11: configure

import org.elasticsearch.river.River; //导入依赖的package包/类
@Override
protected void configure()
{
	bind(River.class).to(CoherenceRiver.class).asEagerSingleton();
}
 
开发者ID:dmcarba,项目名称:elasticsearch-river-coherence,代码行数:6,代码来源:CoherenceRiverModule.java

示例12: configure

import org.elasticsearch.river.River; //导入依赖的package包/类
@Override
protected void configure() {
    bind(River.class).to(JDBCRiver.class).asEagerSingleton();
}
 
开发者ID:szwork2013,项目名称:elasticsearch-sentiment,代码行数:5,代码来源:JDBCRiverModule.java

示例13: configure

import org.elasticsearch.river.River; //导入依赖的package包/类
@Override
protected void configure() {
    bind(River.class).to(KafkaRiver.class).asEagerSingleton();
}
 
开发者ID:endgameinc,项目名称:elasticsearch-river-kafka,代码行数:5,代码来源:KafkaRiverModule.java

示例14: configure

import org.elasticsearch.river.River; //导入依赖的package包/类
@Override
protected void configure() {
	bind(River.class).to(HBaseRiver.class).asEagerSingleton();
}
 
开发者ID:mallocator,项目名称:Elasticsearch-HBase-River,代码行数:5,代码来源:HBaseRiverModule.java

示例15: configure

import org.elasticsearch.river.River; //导入依赖的package包/类
@Override
protected void configure() {
    bind(River.class).to(Neo4jDriver.class).asEagerSingleton();
}
 
开发者ID:sksamuel,项目名称:elasticsearch-river-neo4j,代码行数:5,代码来源:Neo4jRiverModule.java


注:本文中的org.elasticsearch.river.River类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。