buggy_function
stringlengths
1
391k
fixed_function
stringlengths
0
392k
@Override protected PutMappingResponse masterOperation(PutMappingRequest request) throws ElasticSearchException { final String[] indices = processIndices(clusterService.state(), request.indices()); MetaDataService.PutMappingResult result = metaDataService.putMapping(indices, request.type(), request....
@Override protected PutMappingResponse masterOperation(PutMappingRequest request) throws ElasticSearchException { final String[] indices = processIndices(clusterService.state(), request.indices()); MetaDataService.PutMappingResult result = metaDataService.putMapping(indices, request.type(), request....
@Override public void merge(JsonMapper mergeWith, JsonMergeContext mergeContext) throws MergeMappingException { if (!(mergeWith instanceof JsonObjectMapper)) { mergeContext.addFailure("Can't merge a non object mapping [" + mergeWith.name() + "] with an object mapping [" + name() + "]"); ...
@Override public void merge(JsonMapper mergeWith, JsonMergeContext mergeContext) throws MergeMappingException { if (!(mergeWith instanceof JsonObjectMapper)) { mergeContext.addConflict("Can't merge a non object mapping [" + mergeWith.name() + "] with an object mapping [" + name() + "]"); ...
protected IndexException(Index index, boolean withSpace, String msg, Throwable cause) { super("[" + index.name() + "]" + (withSpace ? " " : "") + msg, cause); this.index = index; }
protected IndexException(Index index, boolean withSpace, String msg, Throwable cause) { super("[" + (index == null ? "_na" : index.name()) + "]" + (withSpace ? " " : "") + msg, cause); this.index = index; }
public IndexShardException(ShardId shardId, String msg, Throwable cause) { super(shardId.index(), false, "[" + shardId.id() + "] " + msg, cause); this.shardId = shardId; }
public IndexShardException(ShardId shardId, String msg, Throwable cause) { super(shardId == null ? null : shardId.index(), false, "[" + shardId == null ? "_na" : shardId.id() + "] " + msg, cause); this.shardId = shardId; }
public static ContentPath.Type parsePathType(String name, String path) throws MapperParsingException { path = Strings.toUnderscoreCase(path); if ("just_name".equals(path)) { return ContentPath.Type.JUST_NAME; } else if ("full".equals(path)) { return ContentPath.Type.F...
public static ContentPath.Type parsePathType(String name, String path) throws MapperParsingException { path = Strings.toUnderscoreCase(path); if ("just_name".equals(path)) { return ContentPath.Type.JUST_NAME; } else if ("full".equals(path)) { return ContentPath.Type.F...
public static native String getFailureReason (); /* gdx2d_get_failure_reason(void); */
public static native String getFailureReason (); /* gdx2d_get_failure_reason(); */
public static void main (String[] argv) { // this is only here for me to debug native code faster new SharedLibraryLoader("../../extensions/gdx-audio/libs/gdx-audio-natives.jar").load("gdx-audio"); new SharedLibraryLoader("../../extensions/gdx-image/libs/gdx-image-natives.jar").load("gdx-image"); new SharedLib...
public static void main (String[] argv) { // this is only here for me to debug native code faster new SharedLibraryLoader("../../extensions/gdx-audio/libs/gdx-audio-natives.jar").load("gdx-audio"); new SharedLibraryLoader("../../extensions/gdx-image/libs/gdx-image-natives.jar").load("gdx-image"); new SharedLib...
public void run() { try { keepAliveLatch.await(); } catch (InterruptedException e) { // bail out } } }, "elasticsearch[keepAlive]"); keepAliveThread.setDaem...
public void run() { try { keepAliveLatch.await(); } catch (InterruptedException e) { // bail out } } }, "elasticsearch[keepAlive/" + Version.CURRENT + "]"); ...
public HttpInfo info() { return new HttpInfo(transport.boundAddress()); }
public HttpInfo info() { return transport.info(); }
public AnalyzeRequestBuilder field(String field) { request.field(field); return this; } }
public AnalyzeRequestBuilder setField(String field) { request.field(field); return this; } }
public void stop () { alSourceStop(streamID); }
public void stop () { if (streamID != -1) alSourceStop(streamID); }
public void execute(RoutingAllocation allocation) throws ElasticSearchException { DiscoveryNode discoNode = allocation.nodes().resolveNode(node); MutableShardRouting shardRouting = null; for (MutableShardRouting routing : allocation.routingNodes().unassigned()) { if (routing.sha...
public void execute(RoutingAllocation allocation) throws ElasticSearchException { DiscoveryNode discoNode = allocation.nodes().resolveNode(node); MutableShardRouting shardRouting = null; for (MutableShardRouting routing : allocation.routingNodes().unassigned()) { if (routing.sha...
public boolean allocateUnassigned(RoutingAllocation allocation) { boolean changed = false; DiscoveryNodes nodes = allocation.nodes(); RoutingNodes routingNodes = allocation.routingNodes(); if (nodes.dataNodes().isEmpty()) { return changed; } if (!routin...
public boolean allocateUnassigned(RoutingAllocation allocation) { boolean changed = false; DiscoveryNodes nodes = allocation.nodes(); RoutingNodes routingNodes = allocation.routingNodes(); if (nodes.dataNodes().isEmpty()) { return changed; } if (!routin...
private InternalSearchRequest searchRequest(SearchSourceBuilder builder) { return new InternalSearchRequest("test", 0, builder.buildAsBytes()); }
private InternalSearchRequest searchRequest(SearchSourceBuilder builder) { return new InternalSearchRequest("test", 0).source(builder.buildAsBytes()); }
public void throttlingTest() throws Exception { Client client = client(); logger.info("--> creating repository"); File repositoryLocation = newTempDir(LifecycleScope.SUITE); boolean throttleSnapshot = randomBoolean(); boolean throttleRestore = randomBoolean(); asser...
public void throttlingTest() throws Exception { Client client = client(); logger.info("--> creating repository"); File repositoryLocation = newTempDir(LifecycleScope.SUITE); boolean throttleSnapshot = randomBoolean(); boolean throttleRestore = randomBoolean(); asser...
public RestApi parse(XContentParser parser) throws IOException { try { while ( parser.nextToken() != XContentParser.Token.FIELD_NAME ) { //move to first field name } RestApi restApi = new RestApi(parser.currentName()); int level = -1; ...
public RestApi parse(XContentParser parser) throws IOException { try { while ( parser.nextToken() != XContentParser.Token.FIELD_NAME ) { //move to first field name } RestApi restApi = new RestApi(parser.currentName()); int level = -1; ...
public static RestSpec parseFrom(String optionalPathPrefix, String... paths) throws IOException { RestSpec restSpec = new RestSpec(); for (String path : paths) { for (File jsonFile : FileUtils.findJsonSpec(optionalPathPrefix, path)) { try { XContentPar...
public static RestSpec parseFrom(String optionalPathPrefix, String... paths) throws IOException { RestSpec restSpec = new RestSpec(); for (String path : paths) { for (File jsonFile : FileUtils.findJsonSpec(optionalPathPrefix, path)) { try { XContentPar...
public void create () { super.create(); final Mesh barMesh = new Mesh(true, 8, 36, new VertexAttribute(Usage.Position, 3, "a_position")); barMesh.setVertices(new float[] {5f, 0.5f, 0.5f, 5f, 0.5f, -0.5f, -5f, 0.5f, 0.5f, -5f, 0.5f, -0.5f, 5f, -0.5f, 0.5f, 5f, -0.5f, -0.5f, -5f, -0.5f, 0.5f, -5f, -0.5f, -0.5f...
public void create () { super.create(); final Mesh barMesh = new Mesh(true, 8, 36, new VertexAttribute(Usage.Position, 3, "a_position")); barMesh.setVertices(new float[] {5f, 0.5f, 0.5f, 5f, 0.5f, -0.5f, -5f, 0.5f, 0.5f, -5f, 0.5f, -0.5f, 5f, -0.5f, 0.5f, 5f, -0.5f, -0.5f, -5f, -0.5f, 0.5f, -5f, -0.5f, -0.5f...
public void create () { super.create(); // Create the entities world.add("ground", 0f, 0f, 0f) .color.set(0.5f * (float)Math.random(), 0.5f * (float)Math.random(), 0.5f * (float)Math.random(), 1f); for (int x = 0; x < BOXCOUNT_X; x++) { for (int y = 0; y < BOXCOUNT_Y; y++) { for (int z = 0; z < BOX...
public void create () { super.create(); // Create the entities world.add("ground", 0f, 0f, 0f) .color.set(0.25f + 0.5f * (float)Math.random(), 0.25f + 0.5f * (float)Math.random(), 0.25f + 0.5f * (float)Math.random(), 1f); for (int x = 0; x < BOXCOUNT_X; x++) { for (int y = 0; y < BOXCOUNT_Y; y++) { ...
public IndexFieldData.WithOrdinals build(final IndexReader indexReader, IndexFieldData.WithOrdinals indexFieldData, Settings settings, CircuitBreakerService breakerService) throws IOException { assert indexReader.leaves().size() > 1; long startTime = System.currentTimeMillis(); // It makes ...
public IndexFieldData.WithOrdinals build(final IndexReader indexReader, IndexFieldData.WithOrdinals indexFieldData, Settings settings, CircuitBreakerService breakerService) throws IOException { assert indexReader.leaves().size() > 1; long startTime = System.currentTimeMillis(); // It makes ...
public void testHasChildQueryOnlyReturnsSingleChildType() { assertAcked(prepareCreate("grandissue") .addMapping("grandparent", "name", "type=string") .addMapping("parent", "_parent", "type=grandparent") .addMapping("child_type_one", "_parent", "type=parent") ...
public void testHasChildQueryOnlyReturnsSingleChildType() { assertAcked(prepareCreate("grandissue") .addMapping("grandparent", "name", "type=string") .addMapping("parent", "_parent", "type=grandparent") .addMapping("child_type_one", "_parent", "type=parent") ...
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View root = inflater.inflate(layout.comment_list_view, null); headerView = inflater.inflate(layout.gist_header, null); created = (TextView) headerView.findViewById(id.tv_gist_crea...
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View root = inflater.inflate(layout.comment_list, null); headerView = inflater.inflate(layout.gist_header, null); created = (TextView) headerView.findViewById(id.tv_gist_creation)...
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return inflater.inflate(layout.comment_list_view, null); }
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return inflater.inflate(layout.comment_list, null); }
ShardIterator shardsIt(); /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under the Apache License, Version 2....
ShardIterator shardsIt(); /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under the Apache License, Version 2....
public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); if (out.getVersion().onOrAfter(Version.V_0_90_4)) { out.writeStringArray(names); } else { out.writeString(names[0]); } }
public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); if (out.getVersion().onOrAfter(Version.V_0_90_4)) { out.writeStringArray(names); } else { out.writeString(names.length == 0 ? "*" : names[0]); } }
public void optimize(Optimize optimize) throws EngineException { if (optimize.flush()) { flush(new Flush().force(true)); } if (optimizeMutex.compareAndSet(false, true)) { rwl.readLock().lock(); try { if (indexWriter == null) { ...
public void optimize(Optimize optimize) throws EngineException { if (optimize.flush()) { flush(new Flush().force(true)); } if (optimizeMutex.compareAndSet(false, true)) { rwl.readLock().lock(); try { if (indexWriter == null) { ...
public long getNumberOfOutboundConnections() { return transport.clientChannels.size(); }
public long getNumberOfOutboundConnections() { return transport.connectedNodes.size(); }
protected ClusterStatsNodeResponse nodeOperation(ClusterStatsNodeRequest nodeRequest) throws ElasticSearchException { NodeInfo nodeInfo = nodeService.info(false, true, false, true, false, false, true, false, true); NodeStats nodeStats = nodeService.stats(CommonStatsFlags.NONE, false, true, true, fal...
protected ClusterStatsNodeResponse nodeOperation(ClusterStatsNodeRequest nodeRequest) throws ElasticSearchException { NodeInfo nodeInfo = nodeService.info(false, true, false, true, false, false, true, false, true); NodeStats nodeStats = nodeService.stats(CommonStatsFlags.NONE, false, true, true, fal...
public <T> T readValue (Class<T> type, Class elementType, JsonValue jsonData) { if (jsonData == null) return null; if (jsonData.isObject()) { String className = typeName == null ? null : jsonData.getString(typeName, null); if (className != null) { jsonData.remove(typeName); try { type = (Class<...
public <T> T readValue (Class<T> type, Class elementType, JsonValue jsonData) { if (jsonData == null) return null; if (jsonData.isObject()) { String className = typeName == null ? null : jsonData.getString(typeName, null); if (className != null) { jsonData.remove(typeName); try { type = (Class<...
public static void main (String[] argv) { // this is only here for me to debug native code faster // new SharedLibraryLoader("../../extensions/gdx-audio/libs/gdx-audio-natives.jar").load("gdx-audio"); // new SharedLibraryLoader("../../extensions/gdx-image/libs/gdx-image-natives.jar").load("gdx-image"); // new Sha...
public static void main (String[] argv) { // this is only here for me to debug native code faster // new SharedLibraryLoader("../../extensions/gdx-audio/libs/gdx-audio-natives.jar").load("gdx-audio"); // new SharedLibraryLoader("../../extensions/gdx-image/libs/gdx-image-natives.jar").load("gdx-image"); // new Sha...
protected void doStart() throws ElasticSearchException { add(localNodeMasterListeners); this.clusterState = newClusterStateBuilder().blocks(initialBlocks).build(); this.updateTasksExecutor = EsExecutors.newSinglePrioritizingThreadExecutor(daemonThreadFactory(settings, "clusterService#updateT...
protected void doStart() throws ElasticSearchException { add(localNodeMasterListeners); this.clusterState = newClusterStateBuilder().blocks(initialBlocks).build(); this.updateTasksExecutor = EsExecutors.newSinglePrioritizing(daemonThreadFactory(settings, "clusterService#updateTask")); ...
public FsGateway(Settings settings, ThreadPool threadPool, ClusterService clusterService, Environment environment, ClusterName clusterName) throws IOException { super(settings, threadPool, clusterService); File gatewayFile; String location = componentSettings.get("locat...
public FsGateway(Settings settings, ThreadPool threadPool, ClusterService clusterService, Environment environment, ClusterName clusterName) throws IOException { super(settings, threadPool, clusterService); File gatewayFile; String location = componentSettings.get("locat...
public RecoverySettings(Settings settings, NodeSettingsService nodeSettingsService) { super(settings); this.fileChunkSize = componentSettings.getAsBytesSize("file_chunk_size", settings.getAsBytesSize("index.shard.recovery.file_chunk_size", new ByteSizeValue(512, ByteSizeUnit.KB))); this.tra...
public RecoverySettings(Settings settings, NodeSettingsService nodeSettingsService) { super(settings); this.fileChunkSize = componentSettings.getAsBytesSize("file_chunk_size", settings.getAsBytesSize("index.shard.recovery.file_chunk_size", new ByteSizeValue(512, ByteSizeUnit.KB))); this.tra...
public Filter parse(QueryParseContext parseContext) throws IOException, QueryParsingException { XContentParser parser = parseContext.parser(); XContentParser.Token token; boolean cache = false; CacheKeyFilter.Key cacheKey = null; String filterName = null; String cur...
public Filter parse(QueryParseContext parseContext) throws IOException, QueryParsingException { XContentParser parser = parseContext.parser(); XContentParser.Token token; boolean cache = false; CacheKeyFilter.Key cacheKey = null; String filterName = null; String cur...
public Filter parse(QueryParseContext parseContext) throws IOException, QueryParsingException { XContentParser parser = parseContext.parser(); XContentParser.Token token; boolean cache = false; CacheKeyFilter.Key cacheKey = null; String filterName = null; String cur...
public Filter parse(QueryParseContext parseContext) throws IOException, QueryParsingException { XContentParser parser = parseContext.parser(); XContentParser.Token token; boolean cache = false; CacheKeyFilter.Key cacheKey = null; String filterName = null; String cur...
public AggregatorFactory parse(String aggregationName, XContentParser parser, SearchContext context) throws IOException { String field = null; List<RangeAggregator.Range> ranges = null; GeoPoint origin = null; DistanceUnit unit = DistanceUnit.KILOMETERS; GeoDistance distance...
public AggregatorFactory parse(String aggregationName, XContentParser parser, SearchContext context) throws IOException { String field = null; List<RangeAggregator.Range> ranges = null; GeoPoint origin = null; DistanceUnit unit = DistanceUnit.KILOMETERS; GeoDistance distance...
public SortField parse(XContentParser parser, SearchContext context) throws Exception { String fieldName = null; GeoPoint point = new GeoPoint(); DistanceUnit unit = DistanceUnit.KILOMETERS; GeoDistance geoDistance = GeoDistance.ARC; boolean reverse = false; SortMode ...
public SortField parse(XContentParser parser, SearchContext context) throws Exception { String fieldName = null; GeoPoint point = new GeoPoint(); DistanceUnit unit = DistanceUnit.KILOMETERS; GeoDistance geoDistance = GeoDistance.DEFAULT; boolean reverse = false; SortM...
public void resize (int width, int height) { stage.getViewport().update(width, height); }
public void resize (int width, int height) { stage.getViewport().update(width, height, true); }
public void resize (int width, int height) { ui.setSize(width, height); ui.invalidate(); stage.getViewport().update(width, height); }
public void resize (int width, int height) { ui.setSize(width, height); ui.invalidate(); stage.getViewport().update(width, height, true); }
public void resize (int width, int height) { stage.getViewport().update(width, height); root.invalidate(); }
public void resize (int width, int height) { stage.getViewport().update(width, height, true); root.invalidate(); }
public void resize (int width, int height) { ui.getViewport().update(width, height); root.setSize(width, height); }
public void resize (int width, int height) { ui.getViewport().update(width, height, true); root.setSize(width, height); }
public void resize (int width, int height) { stage.getViewport().update(width, height); table.invalidateHierarchy(); renderer.setProjectionMatrix(stage.getViewport().getCamera().combined); }
public void resize (int width, int height) { stage.getViewport().update(width, height, true); table.invalidateHierarchy(); renderer.setProjectionMatrix(stage.getViewport().getCamera().combined); }
public void resize (int width, int height) { stage.getViewport().update(width, height); // Gdx.gl.glViewport(100, 100, width - 200, height - 200); // stage.setViewport(800, 600, false, 100, 100, width - 200, height - 200); }
public void resize (int width, int height) { stage.getViewport().update(width, height, true); // Gdx.gl.glViewport(100, 100, width - 200, height - 200); // stage.setViewport(800, 600, false, 100, 100, width - 200, height - 200); }
public void resize (int width, int height) { stage.getViewport().update(width, height); // Gdx.gl.glViewport(100, 100, width - 200, height - 200); // stage.setViewport(800, 600, false, 100, 100, width - 200, height - 200); }
public void resize (int width, int height) { stage.getViewport().update(width, height, true); // Gdx.gl.glViewport(100, 100, width - 200, height - 200); // stage.setViewport(800, 600, false, 100, 100, width - 200, height - 200); }
public void resize (int width, int height) { stage.getViewport().update(width, height); // root.width = width; // root.height = height; // root.invalidate(); }
public void resize (int width, int height) { stage.getViewport().update(width, height, true); // root.width = width; // root.height = height; // root.invalidate(); }
public void render () { batch.setProjectionMatrix(camera.projection); batch.setTransformMatrix(camera.view); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); batch.begin(); // draw a white background so we are able to see the black bars batch.setColor(1, 1, 1, 1); batch.draw(texture, -4096, -4096, 4096, 4096, ...
public void render () { batch.setProjectionMatrix(camera.projection); batch.setTransformMatrix(camera.view); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); batch.begin(); // draw a white background so we are able to see the black bars batch.setColor(1, 1, 1, 1); batch.draw(texture, -4096, -4096, 4096, 4096, ...
public void resize (int width, int height) { super.resize(width, height); hud.getViewport().update(width, height); hudWidth = hud.getWidth(); hudHeight = hud.getHeight(); }
public void resize (int width, int height) { super.resize(width, height); hud.getViewport().update(width, height, true); hudWidth = hud.getWidth(); hudHeight = hud.getHeight(); }
public void resize (int width, int height) { ui.getViewport().update(width, height); container.setSize(width, height); if (test != null) { test.resize(width, height); } }
public void resize (int width, int height) { ui.getViewport().update(width, height, true); container.setSize(width, height); if (test != null) { test.resize(width, height); } }
protected ListAdapter adapterFor(List<Issue> items) { return new ViewHoldingListAdapter<Issue>(items, viewInflatorFor(getActivity(), layout.repo_issue_list_item), reflectiveFactoryFor(RepoIssueViewHolder.class)); }
protected ListAdapter adapterFor(List<Issue> items) { return new ViewHoldingListAdapter<Issue>(items, viewInflatorFor(getActivity(), layout.repo_issue_list_item), reflectiveFactoryFor(RepoIssueViewHolder.class, RepoIssueViewHolder.computeMaxDigits(items))); }
public <Request extends ActionRequest, Response extends ActionResponse> void registerAction(GenericAction<Request, Response> action, Class<? extends TransportAction<Request, Response>> transportAction, Class... supportTransportActions) { actions.put(action.name(), new ActionEntry<Request, Response>(action, ...
public <Request extends ActionRequest, Response extends ActionResponse> void registerAction(GenericAction<Request, Response> action, Class<? extends TransportAction<Request, Response>> transportAction, Class... supportTransportActions) { actions.put(action.name(), new ActionEntry<>(action, transportAction, ...
public ListenableActionFuture<Response> execute() { PlainListenableActionFuture<Response> future = new PlainListenableActionFuture<Response>(request.listenerThreaded(), client.threadPool()); execute(future); return future; }
public ListenableActionFuture<Response> execute() { PlainListenableActionFuture<Response> future = new PlainListenableActionFuture<>(request.listenerThreaded(), client.threadPool()); execute(future); return future; }
protected NodesInfoResponse newResponse(NodesInfoRequest nodesInfoRequest, AtomicReferenceArray responses) { final List<NodeInfo> nodesInfos = new ArrayList<NodeInfo>(); for (int i = 0; i < responses.length(); i++) { Object resp = responses.get(i); if (resp instanceof NodeInf...
protected NodesInfoResponse newResponse(NodesInfoRequest nodesInfoRequest, AtomicReferenceArray responses) { final List<NodeInfo> nodesInfos = new ArrayList<>(); for (int i = 0; i < responses.length(); i++) { Object resp = responses.get(i); if (resp instanceof NodeInfo) { ...
public ClusterStatsIndices(ClusterStatsNodeResponse[] nodeResponses) { ObjectObjectOpenHashMap<String, ShardStats> countsPerIndex = new ObjectObjectOpenHashMap<String, ShardStats>(); this.docs = new DocsStats(); this.store = new StoreStats(); this.fieldData = new FieldDataStats(); ...
public ClusterStatsIndices(ClusterStatsNodeResponse[] nodeResponses) { ObjectObjectOpenHashMap<String, ShardStats> countsPerIndex = new ObjectObjectOpenHashMap<>(); this.docs = new DocsStats(); this.store = new StoreStats(); this.fieldData = new FieldDataStats(); this.filter...
public void readFrom(StreamInput in) throws IOException { super.readFrom(in); int size = in.readVInt(); pendingTasks = new ArrayList<PendingClusterTask>(size); for (int i = 0; i < size; i++) { PendingClusterTask task = new PendingClusterTask(); task.readFrom(i...
public void readFrom(StreamInput in) throws IOException { super.readFrom(in); int size = in.readVInt(); pendingTasks = new ArrayList<>(size); for (int i = 0; i < size; i++) { PendingClusterTask task = new PendingClusterTask(); task.readFrom(in); pe...
public void readFrom(StreamInput in) throws IOException { super.readFrom(in); int size = in.readVInt(); ImmutableOpenMap.Builder<String, List<AliasMetaData>> aliasesBuilder = ImmutableOpenMap.builder(); for (int i = 0; i < size; i++) { String key = in.readString(); ...
public void readFrom(StreamInput in) throws IOException { super.readFrom(in); int size = in.readVInt(); ImmutableOpenMap.Builder<String, List<AliasMetaData>> aliasesBuilder = ImmutableOpenMap.builder(); for (int i = 0; i < size; i++) { String key = in.readString(); ...
public void readFrom(StreamInput in) throws IOException { super.readFrom(in); int size = in.readVInt(); tokens = new ArrayList<AnalyzeToken>(size); for (int i = 0; i < size; i++) { tokens.add(AnalyzeToken.readAnalyzeToken(in)); }
public void readFrom(StreamInput in) throws IOException { super.readFrom(in); int size = in.readVInt(); tokens = new ArrayList<>(size); for (int i = 0; i < size; i++) { tokens.add(AnalyzeToken.readAnalyzeToken(in)); }
public void readFrom(StreamInput in) throws IOException { super.readFrom(in); shardRouting = readShardRoutingEntry(in); int size = in.readVInt(); if (size == 0) { segments = ImmutableList.of(); } else { segments = new ArrayList<Segment>(size); ...
public void readFrom(StreamInput in) throws IOException { super.readFrom(in); shardRouting = readShardRoutingEntry(in); int size = in.readVInt(); if (size == 0) { segments = ImmutableList.of(); } else { segments = new ArrayList<>(size); for...
public void readFrom(StreamInput in) throws IOException { super.readFrom(in); valid = in.readBoolean(); int size = in.readVInt(); if (size > 0) { queryExplanations = new ArrayList<QueryExplanation>(size); for (int i = 0; i < size; i++) { queryE...
public void readFrom(StreamInput in) throws IOException { super.readFrom(in); valid = in.readBoolean(); int size = in.readVInt(); if (size > 0) { queryExplanations = new ArrayList<>(size); for (int i = 0; i < size; i++) { queryExplanations.add(...
private void addPayload(Object payload) { if (payloads == null) { if (payload == null) { return; } payloads = new ArrayList<Object>(requests.size() + 10); // add requests#size-1 elements to the payloads if it null (we add for an *existing* requ...
private void addPayload(Object payload) { if (payloads == null) { if (payload == null) { return; } payloads = new ArrayList<>(requests.size() + 10); // add requests#size-1 elements to the payloads if it null (we add for an *existing* request) ...
protected PrimaryResponse<BulkShardResponse, BulkShardRequest> shardOperationOnPrimary(ClusterState clusterState, PrimaryOperationRequest shardRequest) { final BulkShardRequest request = shardRequest.request; IndexShard indexShard = indicesService.indexServiceSafe(shardRequest.request.index()).shard...
protected PrimaryResponse<BulkShardResponse, BulkShardRequest> shardOperationOnPrimary(ClusterState clusterState, PrimaryOperationRequest shardRequest) { final BulkShardRequest request = shardRequest.request; IndexShard indexShard = indicesService.indexServiceSafe(shardRequest.request.index()).shard...
protected PrimaryResponse<DeleteResponse, DeleteRequest> shardOperationOnPrimary(ClusterState clusterState, PrimaryOperationRequest shardRequest) { DeleteRequest request = shardRequest.request; IndexShard indexShard = indicesService.indexServiceSafe(shardRequest.request.index()).shardSafe(shardReque...
protected PrimaryResponse<DeleteResponse, DeleteRequest> shardOperationOnPrimary(ClusterState clusterState, PrimaryOperationRequest shardRequest) { DeleteRequest request = shardRequest.request; IndexShard indexShard = indicesService.indexServiceSafe(shardRequest.request.index()).shardSafe(shardReque...
protected PrimaryResponse<ShardDeleteResponse, ShardDeleteRequest> shardOperationOnPrimary(ClusterState clusterState, PrimaryOperationRequest shardRequest) { ShardDeleteRequest request = shardRequest.request; IndexShard indexShard = indicesService.indexServiceSafe(shardRequest.request.index()).shard...
protected PrimaryResponse<ShardDeleteResponse, ShardDeleteRequest> shardOperationOnPrimary(ClusterState clusterState, PrimaryOperationRequest shardRequest) { ShardDeleteRequest request = shardRequest.request; IndexShard indexShard = indicesService.indexServiceSafe(shardRequest.request.index()).shard...
public void readFrom(StreamInput in) throws IOException { super.readFrom(in); source = in.readBytesReference(); int typesSize = in.readVInt(); if (typesSize > 0) { types = new String[typesSize]; for (int i = 0; i < typesSize; i++) { types[i] = ...
public void readFrom(StreamInput in) throws IOException { super.readFrom(in); source = in.readBytesReference(); int typesSize = in.readVInt(); if (typesSize > 0) { types = new String[typesSize]; for (int i = 0; i < typesSize; i++) { types[i] = ...
public void readFrom(StreamInput in) throws IOException { super.readFrom(in); source = in.readBytesReference(); shardId = in.readVInt(); types = in.readStringArray(); int routingSize = in.readVInt(); if (routingSize > 0) { routing = new HashSet<String>(rou...
public void readFrom(StreamInput in) throws IOException { super.readFrom(in); source = in.readBytesReference(); shardId = in.readVInt(); types = in.readStringArray(); int routingSize = in.readVInt(); if (routingSize > 0) { routing = new HashSet<>(routingSi...
protected PrimaryResponse<ShardDeleteByQueryResponse, ShardDeleteByQueryRequest> shardOperationOnPrimary(ClusterState clusterState, PrimaryOperationRequest shardRequest) { ShardDeleteByQueryRequest request = shardRequest.request; IndexService indexService = indicesService.indexServiceSafe(shardReque...
protected PrimaryResponse<ShardDeleteByQueryResponse, ShardDeleteByQueryRequest> shardOperationOnPrimary(ClusterState clusterState, PrimaryOperationRequest shardRequest) { ShardDeleteByQueryRequest request = shardRequest.request; IndexService indexService = indicesService.indexServiceSafe(shardReque...
protected PrimaryResponse<IndexResponse, IndexRequest> shardOperationOnPrimary(ClusterState clusterState, PrimaryOperationRequest shardRequest) { final IndexRequest request = shardRequest.request; // validate, if routing is required, that we got routing IndexMetaData indexMetaData = cluster...
protected PrimaryResponse<IndexResponse, IndexRequest> shardOperationOnPrimary(ClusterState clusterState, PrimaryOperationRequest shardRequest) { final IndexRequest request = shardRequest.request; // validate, if routing is required, that we got routing IndexMetaData indexMetaData = cluster...
private String[] parseArray(XContentParser parser) throws IOException { final List<String> list = new ArrayList<String>(); assert parser.currentToken() == XContentParser.Token.START_ARRAY; while (parser.nextToken() != XContentParser.Token.END_ARRAY) { list.add(parser.text()); ...
private String[] parseArray(XContentParser parser) throws IOException { final List<String> list = new ArrayList<>(); assert parser.currentToken() == XContentParser.Token.START_ARRAY; while (parser.nextToken() != XContentParser.Token.END_ARRAY) { list.add(parser.text()); }...
public static ParsedScrollId parseScrollId(String scrollId) { CharsRef spare = new CharsRef(); try { byte[] decode = Base64.decode(scrollId, Base64.URL_SAFE); UnicodeUtil.UTF8toUTF16(decode, 0, decode.length, spare); } catch (IOException e) { throw new Ela...
public static ParsedScrollId parseScrollId(String scrollId) { CharsRef spare = new CharsRef(); try { byte[] decode = Base64.decode(scrollId, Base64.URL_SAFE); UnicodeUtil.UTF8toUTF16(decode, 0, decode.length, spare); } catch (IOException e) { throw new Ela...
protected SuggestResponse newResponse(SuggestRequest request, AtomicReferenceArray shardsResponses, ClusterState clusterState) { int successfulShards = 0; int failedShards = 0; final Map<String, List<Suggest.Suggestion>> groupedSuggestions = new HashMap<String, List<Suggest.Suggestion>>(); ...
protected SuggestResponse newResponse(SuggestRequest request, AtomicReferenceArray shardsResponses, ClusterState clusterState) { int successfulShards = 0; int failedShards = 0; final Map<String, List<Suggest.Suggestion>> groupedSuggestions = new HashMap<>(); List<ShardOperationFail...
public static <T> PlainActionFuture<T> newFuture() { return new PlainActionFuture<T>(); }
public static <T> PlainActionFuture<T> newFuture() { return new PlainActionFuture<>(); }
public void execute(Request request, ActionListener<Response> listener) { if (request.listenerThreaded()) { listener = new ThreadedActionListener<Response>(threadPool, listener, logger); } ActionRequestValidationException validationException = request.validate(); if (vali...
public void execute(Request request, ActionListener<Response> listener) { if (request.listenerThreaded()) { listener = new ThreadedActionListener<>(threadPool, listener, logger); } ActionRequestValidationException validationException = request.validate(); if (validationEx...
public TermVectorFields(BytesReference headerRef, BytesReference termVectors) throws IOException { BytesStreamInput header = new BytesStreamInput(headerRef); fieldMap = new ObjectLongOpenHashMap<String>(); // here we read the header to fill the field offset map String headerString =...
public TermVectorFields(BytesReference headerRef, BytesReference termVectors) throws IOException { BytesStreamInput header = new BytesStreamInput(headerRef); fieldMap = new ObjectLongOpenHashMap<>(); // here we read the header to fill the field offset map String headerString = heade...
public NodeClient(Settings settings, ThreadPool threadPool, NodeAdminClient admin, Map<GenericAction, TransportAction> actions) { this.settings = settings; this.threadPool = threadPool; this.admin = admin; MapBuilder<Action, TransportAction> actionsBuilder = new MapBuilder<Action, Tr...
public NodeClient(Settings settings, ThreadPool threadPool, NodeAdminClient admin, Map<GenericAction, TransportAction> actions) { this.settings = settings; this.threadPool = threadPool; this.admin = admin; MapBuilder<Action, TransportAction> actionsBuilder = new MapBuilder<>(); ...
public NodeClusterAdminClient(Settings settings, ThreadPool threadPool, Map<GenericAction, TransportAction> actions) { this.threadPool = threadPool; MapBuilder<ClusterAction, TransportAction> actionsBuilder = new MapBuilder<ClusterAction, TransportAction>(); for (Map.Entry<GenericAction, Tra...
public NodeClusterAdminClient(Settings settings, ThreadPool threadPool, Map<GenericAction, TransportAction> actions) { this.threadPool = threadPool; MapBuilder<ClusterAction, TransportAction> actionsBuilder = new MapBuilder<>(); for (Map.Entry<GenericAction, TransportAction> entry : actions....
public NodeIndicesAdminClient(Settings settings, ThreadPool threadPool, Map<GenericAction, TransportAction> actions) { this.threadPool = threadPool; MapBuilder<IndicesAction, TransportAction> actionsBuilder = new MapBuilder<IndicesAction, TransportAction>(); for (Map.Entry<GenericAction, Tra...
public NodeIndicesAdminClient(Settings settings, ThreadPool threadPool, Map<GenericAction, TransportAction> actions) { this.threadPool = threadPool; MapBuilder<IndicesAction, TransportAction> actionsBuilder = new MapBuilder<>(); for (Map.Entry<GenericAction, TransportAction> entry : actions....
public InternalTransportClient(Settings settings, ThreadPool threadPool, TransportService transportService, TransportClientNodesService nodesService, InternalTransportAdminClient adminClient, Map<String, GenericAction> actions) { this.set...
public InternalTransportClient(Settings settings, ThreadPool threadPool, TransportService transportService, TransportClientNodesService nodesService, InternalTransportAdminClient adminClient, Map<String, GenericAction> actions) { this.set...
public InternalTransportClusterAdminClient(Settings settings, TransportClientNodesService nodesService, ThreadPool threadPool, TransportService transportService, Map<String, GenericAction> actions) { this.nodesService = nodesService; this.threadPool = t...
public InternalTransportClusterAdminClient(Settings settings, TransportClientNodesService nodesService, ThreadPool threadPool, TransportService transportService, Map<String, GenericAction> actions) { this.nodesService = nodesService; this.threadPool = t...
public InternalTransportIndicesAdminClient(Settings settings, TransportClientNodesService nodesService, TransportService transportService, ThreadPool threadPool, Map<String, GenericAction> actions) { this.nodesService = nodesService; this.threadPool = t...
public InternalTransportIndicesAdminClient(Settings settings, TransportClientNodesService nodesService, TransportService transportService, ThreadPool threadPool, Map<String, GenericAction> actions) { this.nodesService = nodesService; this.threadPool = t...
public static DiscoveryNodeFilters buildFromKeyValue(OpType opType, Map<String, String> filters) { Map<String, String[]> bFilters = new HashMap<String, String[]>(); for (Map.Entry<String, String> entry : filters.entrySet()) { String[] values = Strings.splitStringByCommaToArray(entry.getV...
public static DiscoveryNodeFilters buildFromKeyValue(OpType opType, Map<String, String> filters) { Map<String, String[]> bFilters = new HashMap<>(); for (Map.Entry<String, String> entry : filters.entrySet()) { String[] values = Strings.splitStringByCommaToArray(entry.getValue()); ...
public String[] resolveNodesIds(String... nodesIds) { if (isAllNodes(nodesIds)) { int index = 0; nodesIds = new String[nodes.size()]; for (DiscoveryNode node : this) { nodesIds[index++] = node.id(); } return nodesIds; } else...
public String[] resolveNodesIds(String... nodesIds) { if (isAllNodes(nodesIds)) { int index = 0; nodesIds = new String[nodes.size()]; for (DiscoveryNode node : this) { nodesIds[index++] = node.id(); } return nodesIds; } else...
public Collection<MutableShardRouting> copyShards() { return new ArrayList<MutableShardRouting>(shards); }
public Collection<MutableShardRouting> copyShards() { return new ArrayList<>(shards); }
public void addIgnoreShardForNode(ShardId shardId, String nodeId) { if (ignoredShardToNodes == null) { ignoredShardToNodes = new HashMap<ShardId, String>(); }
public void addIgnoreShardForNode(ShardId shardId, String nodeId) { if (ignoredShardToNodes == null) { ignoredShardToNodes = new HashMap<>(); }
public ParseField(String value, String... deprecatedNames) { camelCaseName = Strings.toCamelCase(value); underscoreName = Strings.toUnderscoreCase(value); if (deprecatedNames == null || deprecatedNames.length == 0) { this.deprecatedNames = Strings.EMPTY_ARRAY; } else { ...
public ParseField(String value, String... deprecatedNames) { camelCaseName = Strings.toCamelCase(value); underscoreName = Strings.toUnderscoreCase(value); if (deprecatedNames == null || deprecatedNames.length == 0) { this.deprecatedNames = Strings.EMPTY_ARRAY; } else { ...
public static <K, V> ObjectObjectOpenHashMap<K, V> newMap(int capacity) { return new ObjectObjectOpenHashMap<K, V>(capacity); }
public static <K, V> ObjectObjectOpenHashMap<K, V> newMap(int capacity) { return new ObjectObjectOpenHashMap<>(capacity); }
public static <V1, V2> Tuple<V1, V2> tuple(V1 v1, V2 v2) { return new Tuple<V1, V2>(v1, v2); }
public static <V1, V2> Tuple<V1, V2> tuple(V1 v1, V2 v2) { return new Tuple<>(v1, v2); }
protected static Coordinate[][] decompose(double dateline, Coordinate[] coordinates) { int offset = 0; ArrayList<Coordinate[]> parts = new ArrayList<Coordinate[]>(); double shift = coordinates[0].x > DATELINE ? DATELINE : (coordinates[0].x < -DATELINE ? -DATELINE : 0); for ...
protected static Coordinate[][] decompose(double dateline, Coordinate[] coordinates) { int offset = 0; ArrayList<Coordinate[]> parts = new ArrayList<>(); double shift = coordinates[0].x > DATELINE ? DATELINE : (coordinates[0].x < -DATELINE ? -DATELINE : 0); for (int i = 1; ...
protected PolygonBuilder(ArrayList<Coordinate> points) { super(); this.shell = new Ring<PolygonBuilder>(this, points); }
protected PolygonBuilder(ArrayList<Coordinate> points) { super(); this.shell = new Ring<>(this, points); }
private static CoordinateNode parseCoordinates(XContentParser parser) throws IOException { XContentParser.Token token = parser.nextToken(); // Base case if (token != XContentParser.Token.START_ARRAY) { double lon = parser.doubleValue(); token = parser.nextToken(); ...
private static CoordinateNode parseCoordinates(XContentParser parser) throws IOException { XContentParser.Token token = parser.nextToken(); // Base case if (token != XContentParser.Token.START_ARRAY) { double lon = parser.doubleValue(); token = parser.nextToken(); ...
public List<TypeListenerBinding> getTypeListenerBindings() { List<TypeListenerBinding> parentBindings = parent.getTypeListenerBindings(); List<TypeListenerBinding> result = new ArrayList<TypeListenerBinding>(parentBindings.size() + 1); result.addAll(parentBindings); r...
public List<TypeListenerBinding> getTypeListenerBindings() { List<TypeListenerBinding> parentBindings = parent.getTypeListenerBindings(); List<TypeListenerBinding> result = new ArrayList<>(parentBindings.size() + 1); result.addAll(parentBindings); result.addAll(listen...
public <T> Initializable<T> requestInjection(InjectorImpl injector, T instance, Object source, Set<InjectionPoint> injectionPoints) { checkNotNull(source); // short circuit if the object has no injections if (instance == null ...
public <T> Initializable<T> requestInjection(InjectorImpl injector, T instance, Object source, Set<InjectionPoint> injectionPoints) { checkNotNull(source); // short circuit if the object has no injections if (instance == null ...
public static <T> TypeLiteral<T> get(Class<T> type) { return new TypeLiteral<T>(type); }
public static <T> TypeLiteral<T> get(Class<T> type) { return new TypeLiteral<>(type); }
public ParameterListKey(List<Type> paramList) { this.paramList = new ArrayList<Type>(paramList); }
public ParameterListKey(List<Type> paramList) { this.paramList = new ArrayList<>(paramList); }
public AbstractBindingBuilder(Binder binder, List<Element> elements, Object source, Key<T> key) { this.binder = binder; this.elements = elements; this.position = elements.size(); this.binding = new UntargettedBindingImpl<T>(source, key, Scoping.UNSCOPED); elements.add(positio...
public AbstractBindingBuilder(Binder binder, List<Element> elements, Object source, Key<T> key) { this.binder = binder; this.elements = elements; this.position = elements.size(); this.binding = new UntargettedBindingImpl<>(source, key, Scoping.UNSCOPED); elements.add(position...
private void toConstant(Class<?> type, Object instance) { // this type will define T, so these assignments are safe @SuppressWarnings("unchecked") Class<T> typeAsClassT = (Class<T>) type; @SuppressWarnings("unchecked") T instanceAsT = (T) instance; if (keyTypeIsSet()...
private void toConstant(Class<?> type, Object instance) { // this type will define T, so these assignments are safe @SuppressWarnings("unchecked") Class<T> typeAsClassT = (Class<T>) type; @SuppressWarnings("unchecked") T instanceAsT = (T) instance; if (keyTypeIsSet()...
public <T> ConstructionContext<T> getConstructionContext(Object key) { ConstructionContext<T> constructionContext = (ConstructionContext<T>) constructionContexts.get(key); if (constructionContext == null) { constructionContext = new ConstructionContext<T>(); c...
public <T> ConstructionContext<T> getConstructionContext(Object key) { ConstructionContext<T> constructionContext = (ConstructionContext<T>) constructionContexts.get(key); if (constructionContext == null) { constructionContext = new ConstructionContext<>(); co...
public List<ProviderMethod<?>> getProviderMethods(Binder binder) { List<ProviderMethod<?>> result = Lists.newArrayList(); for (Class<?> c = delegate.getClass(); c != Object.class; c = c.getSuperclass()) { for (Method method : c.getDeclaredMethods()) { if (method.getAnnota...
public List<ProviderMethod<?>> getProviderMethods(Binder binder) { List<ProviderMethod<?>> result = Lists.newArrayList(); for (Class<?> c = delegate.getClass(); c != Object.class; c = c.getSuperclass()) { for (Method method : c.getDeclaredMethods()) { if (method.getAnnota...
public static <T> Matcher<T> not(final Matcher<? super T> p) { return new Not<T>(p); }
public static <T> Matcher<T> not(final Matcher<? super T> p) { return new Not<>(p); }
public static <T> Dependency<T> get(Key<T> key) { return new Dependency<T>(null, key, true, -1); }
public static <T> Dependency<T> get(Key<T> key) { return new Dependency<>(null, key, true, -1); }
public static int maxOpenFiles(File testDir) { boolean dirCreated = false; if (!testDir.exists()) { dirCreated = true; testDir.mkdirs(); } List<RandomAccessFile> files = new ArrayList<RandomAccessFile>(); try { while (true) { ...
public static int maxOpenFiles(File testDir) { boolean dirCreated = false; if (!testDir.exists()) { dirCreated = true; testDir.mkdirs(); } List<RandomAccessFile> files = new ArrayList<>(); try { while (true) { files.add(new ...
public DocIdSet getDocIdSet(AtomicReaderContext context, Bits acceptDocs) throws IOException { if (filters.size() == 1) { return filters.get(0).getDocIdSet(context, acceptDocs); } List<DocIdSet> sets = new ArrayList<DocIdSet>(filters.size()); for (int i = 0; i < filters.s...
public DocIdSet getDocIdSet(AtomicReaderContext context, Bits acceptDocs) throws IOException { if (filters.size() == 1) { return filters.get(0).getDocIdSet(context, acceptDocs); } List<DocIdSet> sets = new ArrayList<>(filters.size()); for (int i = 0; i < filters.size(); i...