private BasicDBObject getFilterForInitialImport(BasicDBObject filter, String id) { Preconditions.checkNotNull(filter); if (id == null) { return filter; } BasicDBObject idFilter = new BasicDBObject(MongoDBRiver.MONGODB_ID_FIELD, new BasicBSONObject(QueryOperators.GT, id)); if (filter.equals(new BasicDBObject())) { return idFilter; } return new BasicDBObject(QueryOperators.AND, ImmutableList.of(filter, idFilter)); }
@Override public Collection<Class<? extends Module>> modules() { return ImmutableList.<Class<? extends Module>>of(IcuIndicesAnalysisModule.class); }
@Override public Collection<Class<? extends Module>> modules() { return ImmutableList.<Class<? extends Module>>of(KuromojiIndicesAnalysisModule.class); }
@Override public Collection<Class<? extends Module>> modules() { return ImmutableList.<Class<? extends Module>>of(AnnotationIndicesAnalysisModule.class); }
public void emptyTargetNodes() { this.targetNodes = ImmutableList.of(); }
@Override public Collection<Class<? extends Module>> modules() { return ImmutableList.<Class<? extends Module>>of(MorfologikIndicesAnalysisModule.class); }
public static InternalAggregations fromXContent(final Map<String, Object> map, final AggregationsManifest aggregationsManifest) { if (!(map.containsKey("aggregations") || map.containsKey("aggs"))) { return new InternalAggregations(ImmutableList.<InternalAggregation>of()); } else { final Map<String, Object> aggregationsMap; if (map.containsKey("aggregations")) { aggregationsMap = nodeMapValue(map.get("aggregations"), String.class, Object.class); } else { aggregationsMap = nodeMapValue(map.get("aggs"), String.class, Object.class); } return fromXContentUnwrapped(aggregationsMap, aggregationsManifest); } }
public static InternalAggregations fromXContent(final Map<String, Object> map, final AggregationsManifest aggregationsManifest) { if (!(map.containsKey("aggregations") || map.containsKey("aggs"))) { return new InternalAggregations(ImmutableList.<InternalAggregation>of()); } else { final Map<String, Object> aggregationsMap; if (map.containsKey("aggregations")) { aggregationsMap = nodeMapValue(map.get("aggregations"), String.class, Object.class); } else { aggregationsMap = nodeMapValue(map.get("aggs"), String.class, Object.class); } return fromXContentUnwrapped(aggregationsMap, aggregationsManifest); } }
@Override public Iterable<? extends Module> spawnModules() { return ImmutableList.of(Modules.createModule(settings.getAsClass("websocket.type", NettyWebSocketServerTransportModule.class, "org.xbib.elasticsearch.websocket.http.", "HttpServerTransportModule"), settings)); }
@Override public Iterable<? extends Module> spawnModules() { return ImmutableList.of(Modules.createModule(settings.getAsClass("http.type", NettyHttpServerTransportModule.class, "org.elasticsearch.http.", "HttpServerTransportModule"), settings)); }
@Override public GetResponse fromXContent(final Map<String, Object> map) { final Map<String, GetField> fields; if (map.containsKey("fields")) { Map<String, Object> incoming = nodeMapValue(map.get("fields"), String.class, Object.class); fields = Maps.newHashMapWithExpectedSize(incoming.size()); for (Map.Entry<String, Object> entry : incoming.entrySet()) { if (entry.getValue() instanceof List) { fields.put(entry.getKey(), new GetField(entry.getKey(), nodeListValue(entry.getValue(), Object.class))); } else { fields.put(entry.getKey(), new GetField(entry.getKey(), ImmutableList.of(entry.getValue()))); } } } else { fields = ImmutableMap.of(); } //noinspection unchecked return new GetResponse(new GetResult( nodeStringValue(map.get("_index")), nodeStringValue(map.get("_type")), nodeStringValue(map.get("_id")), nodeLongValue(map.get("_version"), -1), nodeBooleanValue(map.get("found"), true), nodeBytesReferenceForMapValue((Map<String, ?>) map.get("_source")), fields )); } }
@Override public GetResponse fromXContent(final Map<String, Object> map) { final Map<String, GetField> fields; if (map.containsKey("fields")) { Map<String, Object> incoming = nodeMapValue(map.get("fields"), String.class, Object.class); fields = Maps.newHashMapWithExpectedSize(incoming.size()); for (Map.Entry<String, Object> entry : incoming.entrySet()) { if (entry.getValue() instanceof List) { fields.put(entry.getKey(), new GetField(entry.getKey(), nodeListValue(entry.getValue(), Object.class))); } else { fields.put(entry.getKey(), new GetField(entry.getKey(), ImmutableList.of(entry.getValue()))); } } } else { fields = ImmutableMap.of(); } return new GetResponse(new GetResult( nodeStringValue(map.get("_index")), nodeStringValue(map.get("_type")), nodeStringValue(map.get("_id")), nodeLongValue(map.get("_version"), -1), nodeBooleanValue(map.get("found"), true), nodeBytesReferenceValue(map.get("_source")), fields )); } }
return new Suggest(ImmutableList.<Suggestion<? extends Entry<? extends Option>>>of());
return new Suggest(ImmutableList.<Suggestion<? extends Entry<? extends Option>>>of());
public static InternalAggregations fromXContentUnwrapped(final Map<String, Object> aggregationsMap, final AggregationsManifest aggregationsManifest) { if (aggregationsManifest == null) { checkArgument(aggregationsMap.isEmpty()); return new InternalAggregations(ImmutableList.<InternalAggregation>of());
public static InternalAggregations fromXContentUnwrapped(final Map<String, Object> aggregationsMap, final AggregationsManifest aggregationsManifest) { if (aggregationsManifest == null) { checkArgument(aggregationsMap.isEmpty()); return new InternalAggregations(ImmutableList.<InternalAggregation>of());
@Inject public Ec2Discovery(Settings settings, ClusterName clusterName, ThreadPool threadPool, TransportService transportService, ClusterService clusterService, NodeSettingsService nodeSettingsService, ZenPingService pingService, DiscoveryNodeService discoveryNodeService, AwsEc2Service ec2Service, DiscoverySettings discoverySettings, ElectMasterService electMasterService, @ClusterDynamicSettings DynamicSettings dynamicSettings, Version version) { super(settings, clusterName, threadPool, transportService, clusterService, nodeSettingsService, discoveryNodeService, pingService, electMasterService, discoverySettings, dynamicSettings); if (settings.getAsBoolean("cloud.enabled", true)) { ImmutableList<? extends ZenPing> zenPings = pingService.zenPings(); UnicastZenPing unicastZenPing = null; for (ZenPing zenPing : zenPings) { if (zenPing instanceof UnicastZenPing) { unicastZenPing = (UnicastZenPing) zenPing; break; } } if (unicastZenPing != null) { // update the unicast zen ping to add cloud hosts provider // and, while we are at it, use only it and not the multicast for example unicastZenPing.addHostsProvider(new AwsEc2UnicastHostsProvider(settings, transportService, ec2Service.client(), version)); pingService.zenPings(ImmutableList.of(unicastZenPing)); } else { logger.warn("failed to apply ec2 unicast discovery, no unicast ping found"); } } } }