buggy_function
stringlengths
1
391k
fixed_function
stringlengths
0
392k
@Override public Query parse(QueryParseContext parseContext) throws IOException, QueryParsingException { XContentParser parser = parseContext.parser(); Query query = null; float boost = 1.0f; String childType = null; String scope = null; String currentFieldName = nu...
@Override public Query parse(QueryParseContext parseContext) throws IOException, QueryParsingException { XContentParser parser = parseContext.parser(); Query query = null; float boost = 1.0f; String childType = null; String scope = null; String currentFieldName = nu...
@Override protected void doXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(TopChildrenQueryParser.NAME); builder.field("query"); queryBuilder.toXContent(builder, params); builder.field("type", childType); if (scope != null) { ...
@Override protected void doXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(TopChildrenQueryParser.NAME); builder.field("query"); queryBuilder.toXContent(builder, params); builder.field("type", childType); if (scope != null) { ...
@Override public Query parse(QueryParseContext parseContext) throws IOException, QueryParsingException { XContentParser parser = parseContext.parser(); Query query = null; float boost = 1.0f; String childType = null; String scope = null; TopChildrenQuery.ScoreType sc...
@Override public Query parse(QueryParseContext parseContext) throws IOException, QueryParsingException { XContentParser parser = parseContext.parser(); Query query = null; float boost = 1.0f; String childType = null; String scope = null; TopChildrenQuery.ScoreType sc...
public List<PendingClusterTask> pendingTasks() { long now = System.currentTimeMillis(); PrioritizedEsThreadPoolExecutor.Pending[] pendings = updateTasksExecutor.getPending(); List<PendingClusterTask> pendingClusterTasks = new ArrayList<>(pendings.length); for (PrioritizedEsThreadPool...
public List<PendingClusterTask> pendingTasks() { long now = System.currentTimeMillis(); PrioritizedEsThreadPoolExecutor.Pending[] pendings = updateTasksExecutor.getPending(); List<PendingClusterTask> pendingClusterTasks = new ArrayList<>(pendings.length); for (PrioritizedEsThreadPool...
protected NodeHotThreads nodeOperation(NodeRequest request) throws ElasticSearchException { HotThreads hotThreads = new HotThreads() .busiestThreads(request.request.threads) .type(request.request.type) .interval(request.request.interval) .threa...
protected NodeHotThreads nodeOperation(NodeRequest request) throws ElasticSearchException { HotThreads hotThreads = new HotThreads() .busiestThreads(request.request.threads) .type(request.request.type) .interval(request.request.interval) .threa...
private Map<String, Object> fillContextMap(Map<String, Object> context) { if (context == null) { context = newHashMap(); } if (clusterService != null) { context.put("localNode", clusterService.state().nodes().localNode()); } return context; }
private Map<String, Object> fillContextMap(Map<String, Object> context) { if (context == null) { context = newHashMap(); } if (clusterService != null) { context.put("localNode", clusterService.localNode()); } return context; }
@Override public void render () { GL10 gl = Gdx.gl10; gl.glViewport(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); gl.glEnable(GL10.GL_DEPTH_TEST); gl.glEnable(GL10.GL_TEXTURE_2D); camera.setViewport(Gdx.graphics.getWidth(), ...
@Override public void render () { GL10 gl = Gdx.gl10; gl.glViewport(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); gl.glEnable(GL10.GL_DEPTH_TEST); gl.glEnable(GL10.GL_TEXTURE_2D); camera.setViewport(Gdx.graphics.getWidth(), ...
public static void main(String[] argv) { new LwjglApplication(new com.badlogic.gdx.tests.UITest(), "UI Test", 480, 320, false); }
public static void main(String[] argv) { new LwjglApplication(new com.badlogic.gdx.tests.VBOVATest(), "UI Test", 480, 320, false); }
protected Settings nodeSettings(int nodeOrdinal) { return settingsBuilder().put("plugin.types", CustomScriptPlugin.class.getName()).put(super.nodeSettings(nodeOrdinal)).build(); }
protected Settings nodeSettings(int nodeOrdinal) { return settingsBuilder().put(super.nodeSettings(nodeOrdinal)).put("plugin.types", CustomScriptPlugin.class.getName()).build(); }
protected Settings nodeSettings(int nodeOrdinal) { return ImmutableSettings.settingsBuilder().put("plugin.types", CustomSuggesterPlugin.class.getName()).put(super.nodeSettings(nodeOrdinal)).build(); }
protected Settings nodeSettings(int nodeOrdinal) { return ImmutableSettings.settingsBuilder().put(super.nodeSettings(nodeOrdinal)).put("plugin.types", CustomSuggesterPlugin.class.getName()).build(); }
protected Settings nodeSettings(int nodeOrdinal) { return ImmutableSettings.settingsBuilder().put("threadpool.search.type", "cached").put(super.nodeSettings(nodeOrdinal)).build(); }
protected Settings nodeSettings(int nodeOrdinal) { return ImmutableSettings.settingsBuilder().put(super.nodeSettings(nodeOrdinal)).put("threadpool.search.type", "cached").build(); }
public void testQuorumRecovery() throws Exception { // clean three nodes logger.info("--> cleaning nodes"); buildNode("node1", settingsBuilder().put("gateway.type", "local").build()); buildNode("node2", settingsBuilder().put("gateway.type", "local").build()); buildNode("node3...
public void testQuorumRecovery() throws Exception { // clean three nodes logger.info("--> cleaning nodes"); buildNode("node1", settingsBuilder().put("gateway.type", "local").build()); buildNode("node2", settingsBuilder().put("gateway.type", "local").build()); buildNode("node3...
public static final List<Class<? extends GdxTest>> tests = new ArrayList<Class<? extends GdxTest>>(Arrays.asList( AnimationTest.class, AccelerometerTest.class, ActionTest.class, ActionSequenceTest.class, LetterBoxTest3.class, GroupTest.class, AlphaTest.class, AtlasIssueTest.class, AssetManagerTest.class, FilterPer...
public static final List<Class<? extends GdxTest>> tests = new ArrayList<Class<? extends GdxTest>>(Arrays.asList( AnimationTest.class, AccelerometerTest.class, ActionTest.class, ActionSequenceTest.class, LetterBoxTest3.class, GroupTest.class, AlphaTest.class, AtlasIssueTest.class, AssetManagerTest.class, FilterPer...
private static Map<String, Array<ModelLoaderHints>> defaultHints = new HashMap<String, Array<ModelLoaderHints>>(); // registering the default loaders here static { /* TODO: Move/Drop support registerLoader("dae", new ColladaLoader(), new ModelLoaderHints(false)); registerLoader("dae", new ColladaLoaderSkeleto...
private static Map<String, Array<ModelLoaderHints>> defaultHints = new HashMap<String, Array<ModelLoaderHints>>(); // registering the default loaders here static { /* TODO: Move/Drop support registerLoader("dae", new ColladaLoader(), new ModelLoaderHints(false)); registerLoader("dae", new ColladaLoaderSkeleto...
protected ShardRecoveryResponse shardOperation(ShardRecoveryRequest request) throws ElasticsearchException { InternalIndexService indexService = (InternalIndexService) indicesService.indexServiceSafe(request.index()); InternalIndexShard indexShard = (InternalIndexShard) indexService.shardSafe(reque...
protected ShardRecoveryResponse shardOperation(ShardRecoveryRequest request) throws ElasticsearchException { InternalIndexService indexService = (InternalIndexService) indicesService.indexServiceSafe(request.index()); InternalIndexShard indexShard = (InternalIndexShard) indexService.shardSafe(reque...
private void applyNewOrUpdatedShards(final ClusterChangedEvent event) throws ElasticsearchException { if (!indicesService.changesAllowed()) { return; } RoutingTable routingTable = event.state().routingTable(); RoutingNodes.RoutingNodeIterator routingNode = event.state()....
private void applyNewOrUpdatedShards(final ClusterChangedEvent event) throws ElasticsearchException { if (!indicesService.changesAllowed()) { return; } RoutingTable routingTable = event.state().routingTable(); RoutingNodes.RoutingNodeIterator routingNode = event.state()....
public XContentBuilder doXContentBody(XContentBuilder builder, Params params) throws IOException { return builder.field("aggregation", aggregation); }
public XContentBuilder doXContentBody(XContentBuilder builder, Params params) throws IOException { return builder.field("value", aggregation); }
private void addCompoundSortField(XContentParser parser, SearchContext context, List<SortField> sortFields) throws Exception { XContentParser.Token token; while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) { if (token == XContentParser.Token.FIELD_NAME) { ...
private void addCompoundSortField(XContentParser parser, SearchContext context, List<SortField> sortFields) throws Exception { XContentParser.Token token; while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) { if (token == XContentParser.Token.FIELD_NAME) { ...
public TransportIndexAction(Settings settings, TransportService transportService, ClusterService clusterService, IndicesService indicesService, ThreadPool threadPool, ShardStateAction shardStateAction, TransportCreateIndexAction createIndexAction, Mapp...
public TransportIndexAction(Settings settings, TransportService transportService, ClusterService clusterService, IndicesService indicesService, ThreadPool threadPool, ShardStateAction shardStateAction, TransportCreateIndexAction createIndexAction, Mapp...
public void updateVertices (int targetOffset, float[] vertices, int sourceOffset, int count) { isDirty = true; final int pos = buffer.position(); buffer.position(targetOffset); BufferUtils.copy(vertices, sourceOffset, buffer, count); buffer.position(pos); bufferChanged(); }
public void updateVertices (int targetOffset, float[] vertices, int sourceOffset, int count) { isDirty = true; final int pos = buffer.position(); buffer.position(targetOffset); BufferUtils.copy(vertices, sourceOffset, count, buffer); buffer.position(pos); bufferChanged(); }
public void updateVertices (int targetOffset, float[] vertices, int sourceOffset, int count) { final int pos = byteBuffer.position(); byteBuffer.position(targetOffset * 4); BufferUtils.copy(vertices, sourceOffset, byteBuffer, count); byteBuffer.position(pos); }
public void updateVertices (int targetOffset, float[] vertices, int sourceOffset, int count) { final int pos = byteBuffer.position(); byteBuffer.position(targetOffset * 4); BufferUtils.copy(vertices, sourceOffset, count, byteBuffer); byteBuffer.position(pos); }
public void updateVertices (int targetOffset, float[] vertices, int sourceOffset, int count) { isDirty = true; final int pos = byteBuffer.position(); byteBuffer.position(targetOffset * 4); BufferUtils.copy(vertices, sourceOffset, byteBuffer, count); byteBuffer.position(pos); buffer.position(0); bufferCha...
public void updateVertices (int targetOffset, float[] vertices, int sourceOffset, int count) { isDirty = true; final int pos = byteBuffer.position(); byteBuffer.position(targetOffset * 4); BufferUtils.copy(vertices, sourceOffset, count, byteBuffer); byteBuffer.position(pos); buffer.position(0); bufferCha...
public void updateVertices (int targetOffset, float[] vertices, int sourceOffset, int count) { isDirty = true; if (isDirect) { final int pos = byteBuffer.position(); byteBuffer.position(targetOffset * 4); BufferUtils.copy(vertices, sourceOffset, byteBuffer, count); byteBuffer.position(pos); } else ...
public void updateVertices (int targetOffset, float[] vertices, int sourceOffset, int count) { isDirty = true; if (isDirect) { final int pos = byteBuffer.position(); byteBuffer.position(targetOffset * 4); BufferUtils.copy(vertices, sourceOffset, count, byteBuffer); byteBuffer.position(pos); } else ...
public static void main (String[] argv) { new JoglApplication(new com.badlogic.gdx.tests.MatrixJNITest(), "Debug Test", 480, 320, false); }
public static void main (String[] argv) { new JoglApplication(new com.badlogic.gdx.tests.CullTest(), "Debug Test", 480, 320, false); }
public void initialize(ApplicationListener listener, AndroidApplicationConfiguration config) { graphics = new AndroidGraphicsLiveWallpaper(this, config.useGL20, config.resolutionStrategy==null?new FillResolutionStrategy():config.resolutionStrategy); input = AndroidInputFactory.newAndroidInput(this, this.getService...
public void initialize(ApplicationListener listener, AndroidApplicationConfiguration config) { graphics = new AndroidGraphicsLiveWallpaper(this, config, config.resolutionStrategy==null?new FillResolutionStrategy():config.resolutionStrategy); input = AndroidInputFactory.newAndroidInput(this, this.getService(), null...
public boolean setDisplayMode (DisplayMode displayMode) { if (!super.setDisplayMode(displayMode)) return false; LwjglAWTCanvas.this.setDisplayMode(displayMode.width, displayMode.height); return true; } }; if (!LwjglApplicationConfiguration.disableAudio && Gdx.audio == null) { audio = new OpenAL...
public boolean setDisplayMode (DisplayMode displayMode) { if (!super.setDisplayMode(displayMode)) return false; LwjglAWTCanvas.this.setDisplayMode(displayMode.width, displayMode.height); return true; } }; if (Gdx.audio == null) { audio = new OpenALAudio(); Gdx.audio = audio; } else { au...
public static BuildTarget newDefaultTarget (BuildTarget.TargetOs type, boolean is64Bit) { if (type == TargetOs.Windows && !is64Bit) { // Windows 32-Bit return new BuildTarget(TargetOs.Windows, false, new String[] {"**/*.c"}, new String[0], new String[] {"**/*.cpp"}, new String[0], new String[0], "i686-w64-...
public static BuildTarget newDefaultTarget (BuildTarget.TargetOs type, boolean is64Bit) { if (type == TargetOs.Windows && !is64Bit) { // Windows 32-Bit return new BuildTarget(TargetOs.Windows, false, new String[] {"**/*.c"}, new String[0], new String[] {"**/*.cpp"}, new String[0], new String[0], "i686-w64-...
public enum GraphicsType { AndroidGL, LWJGL, Angle, WebGL, iOSGL }
public enum GraphicsType { AndroidGL, JoglGL, LWJGL, Angle, WebGL, iOSGL }
public static String VERSION = "0.9.8"; }
public static String VERSION = "0.9.7"; }
private void addGlyph (Glyph glyph, float x, float y, float width, float height) { float x2 = x + width; float y2 = y + height; final float u = glyph.u; final float u2 = glyph.u2; final float v = glyph.v; final float v2 = glyph.v2; final float[] vertices = this.vertices; if (integer) { x = Math.ro...
private void addGlyph (Glyph glyph, float x, float y, float width, float height) { float x2 = x + width; float y2 = y + height; final float u = glyph.u; final float u2 = glyph.u2; final float v = glyph.v; final float v2 = glyph.v2; final float[] vertices = this.vertices; if (integer) { x = Math.ro...
private Node buildNode() { Settings settings = settingsBuilder() .put("gateway.type", "hdfs") .put("gateway.hdfs.uri", "file:///") // .put("gateway.hdfs.uri", "hdfs://training-vm.local:8022") .put("gateway.hdfs.path", "work/hdfs/gateway") ...
private Node buildNode() { Settings settings = settingsBuilder() .put("gateway.type", "hdfs") .put("gateway.hdfs.uri", "file:///") // .put("gateway.hdfs.uri", "hdfs://training-vm.local:8022") .put("gateway.hdfs.path", "data/hdfs/gateway") ...
public void merge(Mapper mergeWith, MergeContext mergeContext) throws MergeMappingException { AbstractFieldMapper mergeWithMultiField = (AbstractFieldMapper) mergeWith; List<FieldMapper> newFieldMappers = null; ImmutableOpenMap.Builder<String, Mapper> newMappersBuilder = nul...
public void merge(Mapper mergeWith, MergeContext mergeContext) throws MergeMappingException { AbstractFieldMapper mergeWithMultiField = (AbstractFieldMapper) mergeWith; List<FieldMapper<?>> newFieldMappers = null; ImmutableOpenMap.Builder<String, Mapper> newMappersBuilder = ...
public void writeDouble (double v) throws IOException { writeLong(Double.doubleToLongBits(v)); }
public void writeDouble (double v) throws IOException { throw new RuntimeException("writeDouble"); }
public static boolean intersectRayBounds (Ray ray, BoundingBox box, Vector3 intersection) { Vector3.tmp.set(ray.origin); Vector3.tmp2.set(ray.origin); Vector3.tmp.sub(box.min); Vector3.tmp2.sub(box.max); if (Vector3.tmp.x > 0 && Vector3.tmp.y > 0 && Vector3.tmp.z > 0 && Vector3.tmp2.x < 0 && Vector3.tmp2.y <...
public static boolean intersectRayBounds (Ray ray, BoundingBox box, Vector3 intersection) { Vector3.tmp.set(ray.origin); Vector3.tmp2.set(ray.origin); Vector3.tmp.sub(box.min); Vector3.tmp2.sub(box.max); if (Vector3.tmp.x > 0 && Vector3.tmp.y > 0 && Vector3.tmp.z > 0 && Vector3.tmp2.x < 0 && Vector3.tmp2.y <...
private native void jniSet (long addr, float[] verts, int offset, int len); /* b2PolygonShape* poly = (b2PolygonShape*)addr; int numVertices = len / 2; b2Vec2* verticesOut = new b2Vec2[numVertices]; for(int i = 0; i < numVertices; i++) { verticesOut[i] = b2Vec2(verts[(i<<1) + offset], verts[(i<<1) + offset...
private native void jniSet (long addr, float[] verts, int offset, int len); /* b2PolygonShape* poly = (b2PolygonShape*)addr; int numVertices = len / 2; b2Vec2* verticesOut = new b2Vec2[numVertices]; for(int i = 0; i < numVertices; i++) { verticesOut[i] = b2Vec2(verts[(i<<1) + offset], verts[(i<<1) + offset...
public Joint createJoint (JointDef def) { long jointAddr = createProperJoint(def); Joint joint = null; if (def.type == JointType.DistanceJoint) joint = new DistanceJoint(this, jointAddr); if (def.type == JointType.FrictionJoint) joint = new FrictionJoint(this, jointAddr); if (def.type == JointType.GearJoint)...
public Joint createJoint (JointDef def) { long jointAddr = createProperJoint(def); Joint joint = null; if (def.type == JointType.DistanceJoint) joint = new DistanceJoint(this, jointAddr); if (def.type == JointType.FrictionJoint) joint = new FrictionJoint(this, jointAddr); if (def.type == JointType.GearJoint)...
public boolean handle (T event) { current++; return current >= count; }
public boolean handle (T event) { current++; return current > count; }
public void resize (int width, int height) { stage.getViewport().update(width, height, true); }
public void resize (int width, int height) { stage.setViewport(width, height, false); }
public void resize (int width, int height) { stage.getViewport().update(width, height, true); }
public void resize (int width, int height) { stage.setViewport(width, height, true); }
@Override public Query query(QueryParseContext parseContext, String queryText) { String fieldName = queryText; Filter filter = null; MapperService.SmartNameFieldMappers smartNameFieldMappers = parseContext.smartFieldMappers(fieldName); if (smartNameFieldMappers != null) { ...
@Override public Query query(QueryParseContext parseContext, String queryText) { String fieldName = queryText; Filter filter = null; MapperService.SmartNameFieldMappers smartNameFieldMappers = parseContext.smartFieldMappers(fieldName); if (smartNameFieldMappers != null) { ...
@Override public Query fieldQuery(String value, QueryParseContext context) { return new DeletionAwareConstantScoreQuery(context.cacheFilter(fieldFilter(value))); }
@Override public Query fieldQuery(String value, QueryParseContext context) { return new DeletionAwareConstantScoreQuery(context.cacheFilter(fieldFilter(value), null)); }
@Override public Filter parse(QueryParseContext parseContext) throws IOException, QueryParsingException { XContentParser parser = parseContext.parser(); String fieldName = null; String filterName = null; XContentParser.Token token; String currentFieldName = null; wh...
@Override public Filter parse(QueryParseContext parseContext) throws IOException, QueryParsingException { XContentParser parser = parseContext.parser(); String fieldName = null; String filterName = null; XContentParser.Token token; String currentFieldName = null; wh...
@Override public Filter parse(QueryParseContext parseContext) throws IOException, QueryParsingException { XContentParser parser = parseContext.parser(); Query query = null; String childType = null; String scope = null; String filterName = null; String currentFieldNa...
@Override public Filter parse(QueryParseContext parseContext) throws IOException, QueryParsingException { XContentParser parser = parseContext.parser(); Query query = null; String childType = null; String scope = null; String filterName = null; String currentFieldNa...
@Override public Query parse(QueryParseContext parseContext) throws IOException, QueryParsingException { XContentParser parser = parseContext.parser(); Query query = null; float boost = 1.0f; String childType = null; String scope = null; String currentFieldName = nu...
@Override public Query parse(QueryParseContext parseContext) throws IOException, QueryParsingException { XContentParser parser = parseContext.parser(); Query query = null; float boost = 1.0f; String childType = null; String scope = null; String currentFieldName = nu...
@Override public Query parse(QueryParseContext parseContext) throws IOException, QueryParsingException { XContentParser parser = parseContext.parser(); Query query = null; float boost = 1.0f; String childType = null; String scope = null; TopChildrenQuery.ScoreType sc...
@Override public Query parse(QueryParseContext parseContext) throws IOException, QueryParsingException { XContentParser parser = parseContext.parser(); Query query = null; float boost = 1.0f; String childType = null; String scope = null; TopChildrenQuery.ScoreType sc...
@Override public Filter parse(QueryParseContext parseContext) throws IOException, QueryParsingException { XContentParser parser = parseContext.parser(); XContentParser.Token token = parser.nextToken(); if (token != XContentParser.Token.FIELD_NAME) { throw new QueryParsingExcepti...
@Override public Filter parse(QueryParseContext parseContext) throws IOException, QueryParsingException { XContentParser parser = parseContext.parser(); XContentParser.Token token = parser.nextToken(); if (token != XContentParser.Token.FIELD_NAME) { throw new QueryParsingExcepti...
@Override public void close() { } }
@Override public void close(boolean delete) { } }
public void dispose () { executor.shutdown(); try { executor.awaitTermination(Long.MAX_VALUE, TimeUnit.SECONDS); } catch (InterruptedException e) { throw new GdxRuntimeException("Couldn't shutdown loading thread", e); } }
public void dispose () { executor.shutdown(); try { executor.awaitTermination(Long.MAX_VALUE, TimeUnit.SECONDS); } catch (InterruptedException e) { new GdxRuntimeException("Couldn't shutdown loading thread"); } }
public InternalSearchResponse merge(ScoreDoc[] sortedDocs, AtomicArray<? extends QuerySearchResultProvider> queryResultsArr, AtomicArray<? extends FetchSearchResultProvider> fetchResultsArr) { List<? extends AtomicArray.Entry<? extends QuerySearchResultProvider>> queryResults = queryResultsArr.asList(); ...
public InternalSearchResponse merge(ScoreDoc[] sortedDocs, AtomicArray<? extends QuerySearchResultProvider> queryResultsArr, AtomicArray<? extends FetchSearchResultProvider> fetchResultsArr) { List<? extends AtomicArray.Entry<? extends QuerySearchResultProvider>> queryResults = queryResultsArr.asList(); ...
public void finishStage(Stage stage) { assert currentState == stage; this.currentState = Stage.NA; }
public void finishStage(Stage stage) { assert currentState == stage : "Expected stage " + stage + " but was stage " + currentState; this.currentState = Stage.NA; }
public static void setupSecondCluster() throws Exception { ElasticsearchIntegrationTest.beforeClass(); // create another cluster cluster2 = new InternalTestCluster(randomLong(), 2, 2, Strings.randomBase64UUID(getRandom()), 0, false); cluster2.beforeTest(getRandom(), 0.1); clu...
public static void setupSecondCluster() throws Exception { ElasticsearchIntegrationTest.beforeClass(); // create another cluster cluster2 = new InternalTestCluster(randomLong(), 2, 2, Strings.randomBase64UUID(getRandom()), 0, false, CHILD_JVM_ID); cluster2.beforeTest(getRandom(), 0.1...
@Override public Query parse(QueryParseContext parseContext) throws IOException, QueryParsingException { XContentParser parser = parseContext.parser(); Filter filter = null; float boost = 1.0f; boolean cache = true; String currentFieldName = null; XContentParser.Tok...
@Override public Query parse(QueryParseContext parseContext) throws IOException, QueryParsingException { XContentParser parser = parseContext.parser(); Filter filter = null; float boost = 1.0f; boolean cache = true; String currentFieldName = null; XContentParser.Tok...
private static String buildMessage(SearchContext context, String msg) { StringBuilder sb = new StringBuilder(); sb.append('[').append(context.shardTarget().index()).append("][").append(context.shardTarget().shardId()).append("]: "); sb.append("query[").append(context.originalQuery()).append(...
private static String buildMessage(SearchContext context, String msg) { StringBuilder sb = new StringBuilder(); sb.append('[').append(context.shardTarget().index()).append("][").append(context.shardTarget().shardId()).append("]: "); sb.append("query[").append(context.parsedQuery().query()).a...
@Override public Query rewrite(Query original) throws IOException { if (original == searchContext.query() || original == searchContext.originalQuery()) { // optimize in case its the top level search query and we already rewrote it... if (searchContext.queryRewritten()) { ...
@Override public Query rewrite(Query original) throws IOException { if (original == searchContext.query() || original == searchContext.parsedQuery().query()) { // optimize in case its the top level search query and we already rewrote it... if (searchContext.queryRewritten()) { ...
public void onFailure(Throwable e) { try { channel.sendResponse(new StringRestResponse(INTERNAL_SERVER_ERROR)); } catch (Exception e1) { logger.error("Failed to send failure response", e1); } } }); ...
public void onFailure(Throwable e) { try { channel.sendResponse(new XContentThrowableRestResponse(request, e)); } catch (Exception e1) { logger.error("Failed to send failure response", e1); } } }); ...
public FileHandle child (String name) { return new GwtFileHandle(preloader, (file.isEmpty() ? "" : (file + (file.endsWith("/") ? "" : "/"))) + name, FileType.Internal); }
public FileHandle child (String name) { return new GwtFileHandle(preloader, file.isEmpty() ? "" : (file + (file.endsWith("/") ? "" : "/")) + name, FileType.Internal); }
private boolean isText (String extension) { return extension.equals("json") || extension.equals("xml") || extension.equals("txt") || extension.equals("glsl") || extension.equals("fnt") || extension.equals("pack") || extension.equals("obj") || extension.equals("atlas"); }
private boolean isText (String extension) { return extension.equals("json") || extension.equals("xml") || extension.equals("txt") || extension.equals("glsl") || extension.equals("fnt") || extension.equals("pack") || extension.equals("obj"); }
public void draw (SpriteBatch batch, float parentAlpha) { BitmapFont font = style.font; Drawable selectedDrawable = style.selection; Color fontColorSelected = style.fontColorSelected; Color fontColorUnselected = style.fontColorUnselected; Color color = getColor(); batch.setColor(color.r, color.g, color.b,...
public void draw (SpriteBatch batch, float parentAlpha) { BitmapFont font = style.font; Drawable selectedDrawable = style.selection; Color fontColorSelected = style.fontColorSelected; Color fontColorUnselected = style.fontColorUnselected; Color color = getColor(); batch.setColor(color.r, color.g, color.b,...
public GlobalOrdinalsSignificantTermsAggregator(String name, AggregatorFactories factories, ValuesSource.Bytes.WithOrdinals.FieldData valuesSource, long estimatedBucketCount, long maxOrd, BucketCountThresholds bucketCountThresholds, ...
public GlobalOrdinalsSignificantTermsAggregator(String name, AggregatorFactories factories, ValuesSource.Bytes.WithOrdinals.FieldData valuesSource, long estimatedBucketCount, long maxOrd, BucketCountThresholds bucketCountThresholds, ...
public SignificantLongTermsAggregator(String name, AggregatorFactories factories, ValuesSource.Numeric valuesSource, @Nullable ValueFormat format, long estimatedBucketCount, BucketCountThresholds bucketCountThresholds, AggregationContext aggregationContext, Aggregator parent, Significant...
public SignificantLongTermsAggregator(String name, AggregatorFactories factories, ValuesSource.Numeric valuesSource, @Nullable ValueFormat format, long estimatedBucketCount, BucketCountThresholds bucketCountThresholds, AggregationContext aggregationContext, Aggregator parent, Significant...
public SignificantStringTermsAggregator(String name, AggregatorFactories factories, ValuesSource valuesSource, long estimatedBucketCount, BucketCountThresholds bucketCountThresholds, IncludeExclude includeExclude, AggregationContext aggregationContext, Aggregator parent, Signific...
public SignificantStringTermsAggregator(String name, AggregatorFactories factories, ValuesSource valuesSource, long estimatedBucketCount, BucketCountThresholds bucketCountThresholds, IncludeExclude includeExclude, AggregationContext aggregationContext, Aggregator parent, Signific...
public boolean exists () { return file.exists(); }
public boolean exists () { return file().exists(); }
public void update (float delta) { if (Gdx.input.isTouched()) { isDone = true; } }
public void update (float delta) { if (Gdx.input.justTouched()) { isDone = true; } }
public void build (String outputDir, String appName, String packageName, String mainClass) { Project project = new Project(); String packageDir = packageName.replace('.', '/'); // root dir/gradle files project.files.add(new ProjectFile("build.gradle", true)); project.files.add(new ProjectFile("settings.g...
public void build (String outputDir, String appName, String packageName, String mainClass) { Project project = new Project(); String packageDir = packageName.replace('.', '/'); // root dir/gradle files project.files.add(new ProjectFile("build.gradle", true)); project.files.add(new ProjectFile("settings.g...
public void draw (Batch spriteBatch) { TextureRegion[] regions = font.getRegions(); for (int j = 0, n = vertexData.length; j < n; j++) { if (idx[j] > 0) { // ignore if this texture has no glyphs float[] vertices = vertexData[j]; spriteBatch.draw(regions[j].getTexture(), vertices, 0, idx[j]); } } }...
public void draw (Batch spriteBatch) { TextureRegion[] regions = font.getRegions(); for (int j = 0, n = vertexData.length; j < n; j++) { if (idx[j] >= 0) { // ignore if this texture has no glyphs float[] vertices = vertexData[j]; spriteBatch.draw(regions[j].getTexture(), vertices, 0, idx[j]); } } ...
public String toString() { return "Index [" + name + "]"; }
public String toString() { return "[" + name + "]"; }
public String toString() { return "Index Shard [" + index.name() + "][" + shardId + "]"; }
public String toString() { return "[" + index.name() + "][" + shardId + "]"; }
protected void doExecute(ActionListener<AliasesExistResponse> listener) { ((IndicesAdminClient) client).aliasesExist(request, listener); }
protected void doExecute(ActionListener<AliasesExistResponse> listener) { client.aliasesExist(request, listener); }
protected void doExecute(ActionListener<GetAliasesResponse> listener) { ((IndicesAdminClient) client).getAliases(request, listener); }
protected void doExecute(ActionListener<GetAliasesResponse> listener) { client.getAliases(request, listener); }
public static void main (String[] args) throws Exception { new NativeCodeGenerator().generate("src/", "bin/", "jni/"); BuildConfig buildConfig = new BuildConfig("gdx-controllers-desktop"); BuildTarget win32home = BuildTarget.newDefaultTarget(TargetOs.Windows, false); win32home.buildFileName = "build-windows32h...
public static void main (String[] args) throws Exception { new NativeCodeGenerator().generate("src/", "bin/", "jni/"); BuildConfig buildConfig = new BuildConfig("gdx-controllers-desktop"); BuildTarget win32home = BuildTarget.newDefaultTarget(TargetOs.Windows, false); win32home.buildFileName = "build-windows32h...
public void execute(SearchContext context) { ResetFieldSelector fieldSelector; List<String> extractFieldNames = null; if (context.hasScriptFields() && !context.hasFieldNames()) { // we ask for script fields, and no field names, don't load the source fieldSelector = Ui...
public void execute(SearchContext context) { ResetFieldSelector fieldSelector; List<String> extractFieldNames = null; if (context.hasScriptFields() && !context.hasFieldNames()) { // we ask for script fields, and no field names, don't load the source fieldSelector = Ui...
public synchronized void load (String sharedLibName) { if (loadedLibraries.contains(sharedLibName)) return; boolean isWindows = System.getProperty("os.name").contains("Windows"); boolean isLinux = System.getProperty("os.name").contains("Linux"); boolean isMac = System.getProperty("os.name").contains("Mac"); ...
public synchronized void load (String sharedLibName) { if (loadedLibraries.contains(sharedLibName)) return; boolean isWindows = System.getProperty("os.name").contains("Windows"); boolean isLinux = System.getProperty("os.name").contains("Linux"); boolean isMac = System.getProperty("os.name").contains("Mac"); ...
public InternalIndexShard routingEntry(ShardRouting shardRouting) { ShardRouting currentRouting = this.shardRouting; if (!shardRouting.shardId().equals(shardId())) { throw new ElasticSearchIllegalArgumentException("Trying to set a routing entry with shardId [" + shardRouting.shardId() + ...
public InternalIndexShard routingEntry(ShardRouting shardRouting) { ShardRouting currentRouting = this.shardRouting; if (!shardRouting.shardId().equals(shardId())) { throw new ElasticSearchIllegalArgumentException("Trying to set a routing entry with shardId [" + shardRouting.shardId() + ...
public float standardDeviation() { if( !hasEnoughData() ) return 0; float mean = getMean(); float sum = 0; for( int i = 0; i < values.length; i++ ) { sum += (values[i] - mean) * (values[i] - mean); } return FastMath.sqrt( sum / values.length ); }
public float standardDeviation() { if( !hasEnoughData() ) return 0; float mean = getMean(); float sum = 0; for( int i = 0; i < values.length; i++ ) { sum += (values[i] - mean) * (values[i] - mean); } return (float)Math.sqrt( sum / values.length ); }
@Override public Query query(QueryParseContext parseContext, String queryText) { String fieldName = queryText; Filter filter = null; MapperService.SmartNameFieldMappers smartNameFieldMappers = parseContext.smartFieldMappers(fieldName); if (smartNameFieldMappers != null) { ...
@Override public Query query(QueryParseContext parseContext, String queryText) { String fieldName = queryText; Filter filter = null; MapperService.SmartNameFieldMappers smartNameFieldMappers = parseContext.smartFieldMappers(fieldName); if (smartNameFieldMappers != null) { ...
@Override public Query parse(QueryParseContext parseContext) throws IOException, QueryParsingException { XContentParser parser = parseContext.parser(); Filter filter = null; float boost = 1.0f; boolean cache = false; String currentFieldName = null; XContentParser.To...
@Override public Query parse(QueryParseContext parseContext) throws IOException, QueryParsingException { XContentParser parser = parseContext.parser(); Filter filter = null; float boost = 1.0f; boolean cache = false; String currentFieldName = null; XContentParser.To...
private void verifyCache(FilterCache filterCache) throws Exception { Directory dir = new RAMDirectory(); IndexWriter indexWriter = new IndexWriter(dir, Lucene.STANDARD_ANALYZER, true, IndexWriter.MaxFieldLength.UNLIMITED); IndexReader reader = indexWriter.getReader(); for (int i = 0...
private void verifyCache(FilterCache filterCache) throws Exception { Directory dir = new RAMDirectory(); IndexWriter indexWriter = new IndexWriter(dir, Lucene.STANDARD_ANALYZER, true, IndexWriter.MaxFieldLength.UNLIMITED); IndexReader reader = indexWriter.getReader(); for (int i = 0...
protected String models[] = new String[] { "car.obj", "cube.obj", "scene.obj", "scene2.obj", "sphere.obj", "wheel.obj", "g3d/knight.g3dj", "g3d/knight.g3db" };
protected String models[] = new String[] { "car.obj", "cube.obj", "scene.obj", "scene2.obj", "sphere.obj", "wheel.obj", "g3d/cube_anim.g3dj", "g3d/cubes.g3dj", "g3d/head_parented.g3dj", "g3d/head.g3dj", "g3d/head2.g3dj", "g3d/teapot.g3db", "g3d/test.g3dj" };
public void setScaleY (float scale) { this.scale.y = scale; updated = false; }
public void setScaleY (float scale) { this.scale.y += scale; updated = false; }
public static boolean intersectRayBounds (Ray ray, BoundingBox box, Vector3 intersection) { Vector3.tmp.set(ray.origin); Vector3.tmp2.set(ray.origin); Vector3.tmp.sub(box.min); Vector3.tmp2.sub(box.max); if (Vector3.tmp.x > 0 && Vector3.tmp.y > 0 && Vector3.tmp.z > 0 && Vector3.tmp2.x < 0 && Vector3.tmp2.y <...
public static boolean intersectRayBounds (Ray ray, BoundingBox box, Vector3 intersection) { Vector3.tmp.set(ray.origin); Vector3.tmp2.set(ray.origin); Vector3.tmp.sub(box.min); Vector3.tmp.sub(box.max); if (Vector3.tmp.x > 0 && Vector3.tmp.y > 0 && Vector3.tmp.z > 0 && Vector3.tmp2.x < 0 && Vector3.tmp2.y < ...
protected void renderWorld () { if (world.performanceCounter != null) world.performanceCounter.start(); if (USE_BULLET_FRUSTUM_CULLING) getEntitiesCollidingWithObject(world, frustumObject, visibleEntities, tempManifoldArr); else { visibleEntities.clear(); for (int i = 0; i < world.entities.size; i++)...
protected void renderWorld () { if (world.performanceCounter != null) world.performanceCounter.start(); if (USE_BULLET_FRUSTUM_CULLING) getEntitiesCollidingWithObject(world, frustumObject, visibleEntities, tempManifoldArr); else { visibleEntities.clear(); for (int i = 0; i < world.entities.size; i++)...
public void simpleIdTests() { client.admin().indices().prepareDelete().execute().actionGet(); client.admin().indices().prepareCreate("test").setSettings(ImmutableSettings.settingsBuilder().put("number_of_shards", 1)).execute().actionGet(); client.prepareIndex("test", "type", "XXX1").setSour...
public void simpleIdTests() { client.admin().indices().prepareDelete().execute().actionGet(); client.admin().indices().prepareCreate("test").setSettings(ImmutableSettings.settingsBuilder().put("number_of_shards", 1)).execute().actionGet(); client.prepareIndex("test", "type", "XXX1").setSour...
public void create () { // copy an internal mp3 to the external storage FileHandle src = Gdx.files.internal("data/iron.mp3"); FileHandle dst = Gdx.files.external("8.12.mp3"); src.copyTo(dst); // create a music instance and start playback Music music = Gdx.audio.newMusic(dst); music.play(); }
public void create () { // copy an internal mp3 to the external storage FileHandle src = Gdx.files.internal("data/8.12.mp3"); FileHandle dst = Gdx.files.external("8.12.mp3"); src.copyTo(dst); // create a music instance and start playback Music music = Gdx.audio.newMusic(dst); music.play(); }
public boolean apply(Object input) { ClusterStateResponse clusterStateResponse = client().admin().cluster().prepareState().setMasterNodeTimeout("500ms").get(); return !clusterStateResponse.getState().routingTable().index("test").allPrimaryShardsActive(); } ...
public boolean apply(Object input) { ClusterStateResponse clusterStateResponse = cluster().smartClient().admin().cluster().prepareState().setMasterNodeTimeout("500ms").get(); return !clusterStateResponse.getState().routingTable().index("test").allPrimaryShardsActive(); ...
public TransportBulkAction(Settings settings, ThreadPool threadPool, TransportService transportService, ClusterService clusterService, TransportShardBulkAction shardBulkAction, TransportCreateIndexAction createIndexAction) { super(settings, threadPool); this.clusterSer...
public TransportBulkAction(Settings settings, ThreadPool threadPool, TransportService transportService, ClusterService clusterService, TransportShardBulkAction shardBulkAction, TransportCreateIndexAction createIndexAction) { super(settings, BulkAction.NAME, threadPool); ...
public TransportMultiGetAction(Settings settings, ThreadPool threadPool, TransportService transportService, ClusterService clusterService, TransportShardMultiGetAction shardAction) { super(settings, threadPool); this.clusterService = clusterService; this.shardAction = shardAction; t...
public TransportMultiGetAction(Settings settings, ThreadPool threadPool, TransportService transportService, ClusterService clusterService, TransportShardMultiGetAction shardAction) { super(settings, MultiGetAction.NAME, threadPool); this.clusterService = clusterService; this.shardAction = sh...
public TransportPutIndexedScriptAction(Settings settings, ThreadPool threadPool, ScriptService scriptService, Client client, TransportService transportService) { super(settings,threadPool, transportService, PutIndexedScrip...
public TransportPutIndexedScriptAction(Settings settings, ThreadPool threadPool, ScriptService scriptService, Client client, TransportService transportService) { super(settings, PutIndexedScriptAction.NAME, threadPool, tra...
public TransportMoreLikeThisAction(Settings settings, ThreadPool threadPool, TransportSearchAction searchAction, TransportGetAction getAction, ClusterService clusterService, IndicesService indicesService, TransportService transportService) { super(settings, threadPool)...
public TransportMoreLikeThisAction(Settings settings, ThreadPool threadPool, TransportSearchAction searchAction, TransportGetAction getAction, ClusterService clusterService, IndicesService indicesService, TransportService transportService) { super(settings, MoreLikeThi...
public TransportMultiPercolateAction(Settings settings, ThreadPool threadPool, TransportShardMultiPercolateAction shardMultiPercolateAction, ClusterService clusterService, TransportService transportService, PercolatorService percolatorService, ...
public TransportMultiPercolateAction(Settings settings, ThreadPool threadPool, TransportShardMultiPercolateAction shardMultiPercolateAction, ClusterService clusterService, TransportService transportService, PercolatorService percolatorService, ...
public TransportClearScrollAction(Settings settings, TransportService transportService, ThreadPool threadPool, ClusterService clusterService, SearchServiceTransportAction searchServiceTransportAction) { super(settings, threadPool); this.clusterService = clusterService; this.searchServiceTran...
public TransportClearScrollAction(Settings settings, TransportService transportService, ThreadPool threadPool, ClusterService clusterService, SearchServiceTransportAction searchServiceTransportAction) { super(settings, ClearScrollAction.NAME, threadPool); this.clusterService = clusterService; ...
public TransportMultiSearchAction(Settings settings, ThreadPool threadPool, TransportService transportService, ClusterService clusterService, TransportSearchAction searchAction) { super(settings, threadPool); this.clusterService = clusterService; this.searchAction = searchAction; tr...
public TransportMultiSearchAction(Settings settings, ThreadPool threadPool, TransportService transportService, ClusterService clusterService, TransportSearchAction searchAction) { super(settings, MultiSearchAction.NAME, threadPool); this.clusterService = clusterService; this.searchAction = s...
public TransportSearchAction(Settings settings, ThreadPool threadPool, TransportService transportService, ClusterService clusterService, TransportSearchDfsQueryThenFetchAction dfsQueryThenFetchAction, TransportSearchQ...
public TransportSearchAction(Settings settings, ThreadPool threadPool, TransportService transportService, ClusterService clusterService, TransportSearchDfsQueryThenFetchAction dfsQueryThenFetchAction, TransportSearchQ...
public TransportSearchScrollAction(Settings settings, ThreadPool threadPool, TransportService transportService, TransportSearchScrollQueryThenFetchAction queryThenFetchAction, TransportSearchScrollQueryAndFetchAction queryAndFetchAction, ...
public TransportSearchScrollAction(Settings settings, ThreadPool threadPool, TransportService transportService, TransportSearchScrollQueryThenFetchAction queryThenFetchAction, TransportSearchScrollQueryAndFetchAction queryAndFetchAction, ...
public TransportSearchTypeAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, SearchServiceTransportAction searchService, SearchPhaseController searchPhaseController) { super(settings, threadPool); this.clusterService = clusterService;...
public TransportSearchTypeAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, SearchServiceTransportAction searchService, SearchPhaseController searchPhaseController) { super(settings, SearchAction.NAME, threadPool); this.clusterServic...
public TransportMultiTermVectorsAction(Settings settings, ThreadPool threadPool, TransportService transportService, ClusterService clusterService, TransportSingleShardMultiTermsVectorAction shardAction) { super(settings, threadPool); this.clusterService = c...
public TransportMultiTermVectorsAction(Settings settings, ThreadPool threadPool, TransportService transportService, ClusterService clusterService, TransportSingleShardMultiTermsVectorAction shardAction) { super(settings, MultiTermVectorsAction.NAME, threadPool); ...
public float getAngleAroundRad (final float axisX, final float axisY, final float axisZ) { final float d = Vector3.dot(this.x, this.y, this.z, axisX, axisY, axisZ); final float l2 = Quaternion.len2(axisX * d, axisY * d, axisZ * d, this.w); return MathUtils.isZero(l2) ? 0f : (float)(2.0 * Math.acos(this.w / Math....
public float getAngleAroundRad (final float axisX, final float axisY, final float axisZ) { final float d = Vector3.dot(this.x, this.y, this.z, axisX, axisY, axisZ); final float l2 = Quaternion.len2(axisX * d, axisY * d, axisZ * d, this.w); return MathUtils.isZero(l2) ? 0f : (float)(2.0 * Math.acos(MathUtils.clam...
public S3Repository(RepositoryName name, RepositorySettings repositorySettings, IndexShardRepository indexShardRepository, AwsS3Service s3Service) throws IOException { super(name.getName(), repositorySettings, indexShardRepository); String bucket = repositorySettings.settings().get("bucket", compon...
public S3Repository(RepositoryName name, RepositorySettings repositorySettings, IndexShardRepository indexShardRepository, AwsS3Service s3Service) throws IOException { super(name.getName(), repositorySettings, indexShardRepository); String bucket = repositorySettings.settings().get("bucket", compon...
import org.apache.lucene.search.similarities.Similarity; /* * Licensed to ElasticSearch and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. ElasticSearch licenses this * file to you under t...
import org.apache.lucene.search.similarities.Similarity; /* * Licensed to ElasticSearch and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. ElasticSearch licenses this * file to you under t...
public boolean scrolled (InputEvent event, float x, float y, int amount) { resetFade(); if (scrollY) setScrollY(amountY + getMouseWheelY() * amount); else if (scrollX) // setScrollX(amountX + getMouseWheelX() * amount); else return false; return true; } }); } void resetFade...
public boolean scrolled (InputEvent event, float x, float y, int amount) { resetFade(); if (scrollY) setScrollY(amountY + getMouseWheelY() * amount); else if (scrollX) // setScrollX(amountX + getMouseWheelX() * amount); else return false; return true; } }); } void resetFade...
public static String VERSION = "0.9.1"; }
public static String VERSION = "0.9.2"; }