org.elasticsearch.cluster.ClusterState.customs()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(9.7k)|赞(0)|评价(0)|浏览(76)

本文整理了Java中org.elasticsearch.cluster.ClusterState.customs()方法的一些代码示例,展示了ClusterState.customs()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ClusterState.customs()方法的具体详情如下:
包路径:org.elasticsearch.cluster.ClusterState
类名称:ClusterState
方法名:customs

ClusterState.customs介绍

暂无

代码示例

代码示例来源:origin: org.elasticsearch/elasticsearch

/**
 * Creates a new {@link RoutingAllocation}
 *  @param deciders {@link AllocationDeciders} to used to make decisions for routing allocations
 * @param routingNodes Routing nodes in the current cluster
 * @param clusterState cluster state before rerouting
 * @param currentNanoTime the nano time to use for all delay allocation calculation (typically {@link System#nanoTime()})
 */
public RoutingAllocation(AllocationDeciders deciders, RoutingNodes routingNodes, ClusterState clusterState, ClusterInfo clusterInfo,
             long currentNanoTime) {
  this.deciders = deciders;
  this.routingNodes = routingNodes;
  this.metaData = clusterState.metaData();
  this.routingTable = clusterState.routingTable();
  this.nodes = clusterState.nodes();
  this.customs = clusterState.customs();
  this.clusterInfo = clusterInfo;
  this.currentNanoTime = currentNanoTime;
}

代码示例来源:origin: org.elasticsearch/elasticsearch

public ClusterState(long version, String stateUUID, ClusterState state) {
  this(state.clusterName, version, stateUUID, state.metaData(), state.routingTable(), state.nodes(), state.blocks(), state.customs(),
    false);
}

代码示例来源:origin: org.elasticsearch/elasticsearch

/**
 * For interoperability with transport clients older than 6.3, we need to strip customs
 * from the cluster state that the client might not be able to deserialize
 *
 * @param clusterState the cluster state to filter the customs from
 * @return the adapted cluster state
 */
public static ClusterState filterCustomsForPre63Clients(ClusterState clusterState) {
  final ClusterState.Builder builder = ClusterState.builder(clusterState);
  clusterState.customs().keysIt().forEachRemaining(name -> {
    if (PRE_6_3_CLUSTER_CUSTOMS_WHITE_LIST.contains(name) == false) {
      builder.removeCustom(name);
    }
  });
  final MetaData.Builder metaBuilder = MetaData.builder(clusterState.metaData());
  clusterState.metaData().customs().keysIt().forEachRemaining(name -> {
    if (PRE_6_3_METADATA_CUSTOMS_WHITE_LIST.contains(name) == false) {
      metaBuilder.removeCustom(name);
    }
  });
  return builder.metaData(metaBuilder).build();
}

代码示例来源:origin: org.elasticsearch/elasticsearch

public Builder(ClusterState state) {
  this.clusterName = state.clusterName;
  this.version = state.version();
  this.uuid = state.stateUUID();
  this.nodes = state.nodes();
  this.routingTable = state.routingTable();
  this.metaData = state.metaData();
  this.blocks = state.blocks();
  this.customs = ImmutableOpenMap.builder(state.customs());
  this.fromDiff = false;
}

代码示例来源:origin: org.elasticsearch/elasticsearch

for (ObjectObjectCursor<String, ClusterState.Custom> custom : currentState.customs()) {
  if (custom.value.isPrivate() == false) {
    builder.putCustom(custom.key, custom.value);

代码示例来源:origin: apache/servicemix-bundles

/**
 * Creates a new {@link RoutingAllocation}
 *  @param deciders {@link AllocationDeciders} to used to make decisions for routing allocations
 * @param routingNodes Routing nodes in the current cluster
 * @param clusterState cluster state before rerouting
 * @param currentNanoTime the nano time to use for all delay allocation calculation (typically {@link System#nanoTime()})
 */
public RoutingAllocation(AllocationDeciders deciders, RoutingNodes routingNodes, ClusterState clusterState, ClusterInfo clusterInfo,
             long currentNanoTime) {
  this.deciders = deciders;
  this.routingNodes = routingNodes;
  this.metaData = clusterState.metaData();
  this.routingTable = clusterState.routingTable();
  this.nodes = clusterState.nodes();
  this.customs = clusterState.customs();
  this.clusterInfo = clusterInfo;
  this.currentNanoTime = currentNanoTime;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

/**
 * Creates a new {@link RoutingAllocation}
 *  @param deciders {@link AllocationDeciders} to used to make decisions for routing allocations
 * @param routingNodes Routing nodes in the current cluster
 * @param clusterState cluster state before rerouting
 * @param currentNanoTime the nano time to use for all delay allocation calculation (typically {@link System#nanoTime()})
 */
public RoutingAllocation(AllocationDeciders deciders, RoutingNodes routingNodes, ClusterState clusterState, ClusterInfo clusterInfo,
             long currentNanoTime) {
  this.deciders = deciders;
  this.routingNodes = routingNodes;
  this.metaData = clusterState.metaData();
  this.routingTable = clusterState.routingTable();
  this.nodes = clusterState.nodes();
  this.customs = clusterState.customs();
  this.clusterInfo = clusterInfo;
  this.currentNanoTime = currentNanoTime;
}

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

/**
 * Creates a new {@link RoutingAllocation}
 *  @param deciders {@link AllocationDeciders} to used to make decisions for routing allocations
 * @param routingNodes Routing nodes in the current cluster
 * @param clusterState cluster state before rerouting
 * @param currentNanoTime the nano time to use for all delay allocation calculation (typically {@link System#nanoTime()})
 */
public RoutingAllocation(AllocationDeciders deciders, RoutingNodes routingNodes, ClusterState clusterState, ClusterInfo clusterInfo,
             long currentNanoTime, boolean retryFailed) {
  this.deciders = deciders;
  this.routingNodes = routingNodes;
  this.metaData = clusterState.metaData();
  this.routingTable = clusterState.routingTable();
  this.nodes = clusterState.nodes();
  this.customs = clusterState.customs();
  this.clusterInfo = clusterInfo;
  this.currentNanoTime = currentNanoTime;
  this.retryFailed = retryFailed;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

public ClusterState(long version, String stateUUID, ClusterState state) {
  this(state.clusterName, version, stateUUID, state.metaData(), state.routingTable(), state.nodes(), state.blocks(), state.customs(),
    false);
}

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

public ClusterState(long version, String stateUUID, ClusterState state) {
  this(state.clusterName, version, stateUUID, state.metaData(), state.routingTable(), state.nodes(), state.blocks(), state.customs(),
    false);
}

代码示例来源:origin: apache/servicemix-bundles

public ClusterState(long version, String stateUUID, ClusterState state) {
  this(state.clusterName, version, stateUUID, state.metaData(), state.routingTable(), state.nodes(), state.blocks(), state.customs(),
    false);
}

代码示例来源:origin: harbby/presto-connectors

public ClusterState(long version, String stateUUID, ClusterState state) {
  this(state.clusterName, version, stateUUID, state.metaData(), state.routingTable(), state.nodes(), state.blocks(), state.customs(), false);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

/**
 * For interoperability with transport clients older than 6.3, we need to strip customs
 * from the cluster state that the client might not be able to deserialize
 *
 * @param clusterState the cluster state to filter the customs from
 * @return the adapted cluster state
 */
public static ClusterState filterCustomsForPre63Clients(ClusterState clusterState) {
  final ClusterState.Builder builder = ClusterState.builder(clusterState);
  clusterState.customs().keysIt().forEachRemaining(name -> {
    if (PRE_6_3_CLUSTER_CUSTOMS_WHITE_LIST.contains(name) == false) {
      builder.removeCustom(name);
    }
  });
  final MetaData.Builder metaBuilder = MetaData.builder(clusterState.metaData());
  clusterState.metaData().customs().keysIt().forEachRemaining(name -> {
    if (PRE_6_3_METADATA_CUSTOMS_WHITE_LIST.contains(name) == false) {
      metaBuilder.removeCustom(name);
    }
  });
  return builder.metaData(metaBuilder).build();
}

代码示例来源:origin: apache/servicemix-bundles

/**
 * For interoperability with transport clients older than 6.3, we need to strip customs
 * from the cluster state that the client might not be able to deserialize
 *
 * @param clusterState the cluster state to filter the customs from
 * @return the adapted cluster state
 */
public static ClusterState filterCustomsForPre63Clients(ClusterState clusterState) {
  final ClusterState.Builder builder = ClusterState.builder(clusterState);
  clusterState.customs().keysIt().forEachRemaining(name -> {
    if (PRE_6_3_CLUSTER_CUSTOMS_WHITE_LIST.contains(name) == false) {
      builder.removeCustom(name);
    }
  });
  final MetaData.Builder metaBuilder = MetaData.builder(clusterState.metaData());
  clusterState.metaData().customs().keysIt().forEachRemaining(name -> {
    if (PRE_6_3_METADATA_CUSTOMS_WHITE_LIST.contains(name) == false) {
      metaBuilder.removeCustom(name);
    }
  });
  return builder.metaData(metaBuilder).build();
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

public Builder(ClusterState state) {
  this.clusterName = state.clusterName;
  this.version = state.version();
  this.uuid = state.stateUUID();
  this.nodes = state.nodes();
  this.routingTable = state.routingTable();
  this.metaData = state.metaData();
  this.blocks = state.blocks();
  this.customs = ImmutableOpenMap.builder(state.customs());
  this.fromDiff = false;
}

代码示例来源:origin: harbby/presto-connectors

public Builder(ClusterState state) {
  this.clusterName = state.clusterName;
  this.version = state.version();
  this.uuid = state.stateUUID();
  this.nodes = state.nodes();
  this.routingTable = state.routingTable();
  this.metaData = state.metaData();
  this.blocks = state.blocks();
  this.customs = ImmutableOpenMap.builder(state.customs());
  this.fromDiff = false;
}

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

public Builder(ClusterState state) {
  this.clusterName = state.clusterName;
  this.version = state.version();
  this.uuid = state.stateUUID();
  this.nodes = state.nodes();
  this.routingTable = state.routingTable();
  this.metaData = state.metaData();
  this.blocks = state.blocks();
  this.customs = ImmutableOpenMap.builder(state.customs());
  this.fromDiff = false;
}

代码示例来源:origin: apache/servicemix-bundles

public Builder(ClusterState state) {
  this.clusterName = state.clusterName;
  this.version = state.version();
  this.uuid = state.stateUUID();
  this.nodes = state.nodes();
  this.routingTable = state.routingTable();
  this.metaData = state.metaData();
  this.blocks = state.blocks();
  this.customs = ImmutableOpenMap.builder(state.customs());
  this.fromDiff = false;
}

代码示例来源:origin: harbby/presto-connectors

builder.customs(currentState.customs());

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

builder.customs(currentState.customs());

相关文章