當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。