buggy_function
stringlengths
1
391k
fixed_function
stringlengths
0
392k
@Override public void run(Timeout timeout) throws Exception { if (timeout.isCancelled()) { return; } final RequestHolder holder = clientHandlers.remove(requestId); if (holder != null) { // add it to the timeout information holder, i...
@Override public void run(Timeout timeout) throws Exception { if (timeout.isCancelled()) { return; } final RequestHolder holder = clientHandlers.remove(requestId); if (holder != null) { // add it to the timeout information holder, i...
public void testHasChildQueryWithNestedInnerObjects() throws Exception { client().admin().indices().prepareCreate("test") .setSettings( ImmutableSettings.settingsBuilder() .put("index.number_of_shards", 1) ...
public void testHasChildQueryWithNestedInnerObjects() throws Exception { client().admin().indices().prepareCreate("test") .setSettings( ImmutableSettings.settingsBuilder() .put("index.number_of_shards", 1) ...
public Term createIndexNameTerm(BytesRef value) { return new Term(indexName, value); } } Names names(); // LUCENE 4 UPGRADE Consider replacing these all with fieldType() and letting consumer pick and choose boolean indexed(); boolean analyzed(); boolean stored();...
public Term createIndexNameTerm(BytesRef value) { return new Term(indexName, value); } } Names names(); // LUCENE 4 UPGRADE Consider replacing these all with fieldType() and letting consumer pick and choose boolean indexed(); boolean tokenized(); boolean stored()...
@Override public Query parse(QueryParseContext parseContext) throws IOException, QueryParsingException { XContentParser parser = parseContext.parser(); Query query = null; float boost = 1.0f; String script = null; String scriptLang = null; Map<String, Object> vars = ...
@Override public Query parse(QueryParseContext parseContext) throws IOException, QueryParsingException { XContentParser parser = parseContext.parser(); Query query = null; float boost = 1.0f; String script = null; String scriptLang = null; Map<String, Object> vars = ...
public ScriptGeoDistanceFacetCollector(String facetName, String fieldName, double lat, double lon, DistanceUnit unit, GeoDistance geoDistance, GeoDistanceFacet.Entry[] entries, SearchContext context, String scriptLang, String scri...
public ScriptGeoDistanceFacetCollector(String facetName, String fieldName, double lat, double lon, DistanceUnit unit, GeoDistance geoDistance, GeoDistanceFacet.Entry[] entries, SearchContext context, String scriptLang, String scri...
public KeyValueScriptHistogramFacetCollector(String facetName, String fieldName, String scriptLang, String valueScript, Map<String, Object> params, long interval, HistogramFacet.ComparatorType comparatorType, SearchContext context) { super(facetName); this.fieldName = fieldName; this.interva...
public KeyValueScriptHistogramFacetCollector(String facetName, String fieldName, String scriptLang, String valueScript, Map<String, Object> params, long interval, HistogramFacet.ComparatorType comparatorType, SearchContext context) { super(facetName); this.fieldName = fieldName; this.interva...
public ScriptStatisticalFacetCollector(String facetName, String scriptLang, String script, Map<String, Object> params, SearchContext context) { super(facetName); this.script = new SearchScript(context.scriptSearchLookup(), scriptLang, script, params, context.scriptService()); }
public ScriptStatisticalFacetCollector(String facetName, String scriptLang, String script, Map<String, Object> params, SearchContext context) { super(facetName); this.script = new SearchScript(context.lookup(), scriptLang, script, params, context.scriptService()); }
public TermsFacetCollector(String facetName, String fieldName, int size, InternalTermsFacet.ComparatorType comparatorType, SearchContext context, ImmutableSet<String> excluded, Pattern pattern, String scriptLang, String script, Map<String, Object> params) { super(facetName); ...
public TermsFacetCollector(String facetName, String fieldName, int size, InternalTermsFacet.ComparatorType comparatorType, SearchContext context, ImmutableSet<String> excluded, Pattern pattern, String scriptLang, String script, Map<String, Object> params) { super(facetName); ...
public TermsFieldsFacetCollector(String facetName, String[] fieldsNames, int size, InternalTermsFacet.ComparatorType comparatorType, SearchContext context, ImmutableSet<String> excluded, Pattern pattern, String scriptLang, String script, Map<String, Object> params) { sup...
public TermsFieldsFacetCollector(String facetName, String[] fieldsNames, int size, InternalTermsFacet.ComparatorType comparatorType, SearchContext context, ImmutableSet<String> excluded, Pattern pattern, String scriptLang, String script, Map<String, Object> params) { sup...
public TermsScriptFieldFacetCollector(String facetName, int size, InternalTermsFacet.ComparatorType comparatorType, SearchContext context, ImmutableSet<String> excluded, Pattern pattern, String scriptLang, String script, Map<String, Object> params) { super(facetName...
public TermsScriptFieldFacetCollector(String facetName, int size, InternalTermsFacet.ComparatorType comparatorType, SearchContext context, ImmutableSet<String> excluded, Pattern pattern, String scriptLang, String script, Map<String, Object> params) { super(facetName...
@Override public void parse(XContentParser parser, SearchContext context) throws Exception { XContentParser.Token token; String currentFieldName = null; while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) { if (token == XContentParser.Token.FIELD_NAME) { ...
@Override public void parse(XContentParser parser, SearchContext context) throws Exception { XContentParser.Token token; String currentFieldName = null; while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) { if (token == XContentParser.Token.FIELD_NAME) { ...
@Override public SortField parse(XContentParser parser, SearchContext context) throws Exception { String script = null; String scriptLang = null; String type = null; Map<String, Object> params = null; boolean reverse = false; XContentParser.Token token; Strin...
@Override public SortField parse(XContentParser parser, SearchContext context) throws Exception { String script = null; String scriptLang = null; String type = null; Map<String, Object> params = null; boolean reverse = false; XContentParser.Token token; Strin...
protected OptimizeResponse optimize() { waitForRelocation(); OptimizeResponse actionGet = client().admin().indices().prepareOptimize().execute().actionGet(); assertNoFailures(actionGet); return actionGet; }
protected OptimizeResponse optimize() { waitForRelocation(); OptimizeResponse actionGet = client().admin().indices().prepareOptimize().setForce(randomBoolean()).execute().actionGet(); assertNoFailures(actionGet); return actionGet; }
public void create () { super.create(); world.add("ground", 0f, 0f, 0f) .getColor().set(0.25f + 0.5f * (float)Math.random(), 0.25f + 0.5f * (float)Math.random(), 0.25f + 0.5f * (float)Math.random(), 1f); float x0 = -2f, y0 = 6f, z0 = -2f; float x1 = 8f, y1 = 6f, z1 = 8f; Vector3 patch00 = new Vector3...
public void create () { super.create(); 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); float x0 = -2f, y0 = 6f, z0 = -2f; float x1 = 8f, y1 = 6f, z1 = 8f; Vector3 patch00 = new Vector3(x0, ...
public void create () { super.create(); world.maxSubSteps = 20; world.add("ground", 0f, 0f, 0f) .getColor().set(0.25f + 0.5f * (float)Math.random(), 0.25f + 0.5f * (float)Math.random(), 0.25f + 0.5f * (float)Math.random(), 1f); // Note: not every model is suitable for a one on one translation with a...
public void create () { super.create(); world.maxSubSteps = 20; 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); // Note: not every model is suitable for a one on one translation with a soft...
public void testRandomDirectoryIOExceptions() throws IOException, InterruptedException, ExecutionException { String mapping = XContentFactory.jsonBuilder(). startObject(). startObject("type"). startObject("properties"). ...
public void testRandomDirectoryIOExceptions() throws IOException, InterruptedException, ExecutionException { String mapping = XContentFactory.jsonBuilder(). startObject(). startObject("type"). startObject("properties"). ...
private FlushResponse flush(boolean ignoreNotAllowed) { waitForRelocation(); FlushResponse actionGet = client().admin().indices().prepareFlush().execute().actionGet(); if (ignoreNotAllowed) { for (ShardOperationFailedException failure : actionGet.getShardFailures()) { ...
private FlushResponse flush(boolean ignoreNotAllowed) { waitForRelocation(); FlushResponse actionGet = client().admin().indices().prepareFlush().setWaitIfOngoing(true).execute().actionGet(); if (ignoreNotAllowed) { for (ShardOperationFailedException failure : actionGet.getShardFa...
@Override protected ThreadLocals.CleanableValue<byte[]> initialValue() { return new ThreadLocals.CleanableValue<byte[]>(new byte[256]); } };
@Override protected ThreadLocals.CleanableValue<byte[]> initialValue() { return new ThreadLocals.CleanableValue<byte[]>(new byte[1024]); } };
public SendRequestTransportException(DiscoveryNode node, String action, Throwable cause) { super(node.name(), node.address(), action, cause); }
public SendRequestTransportException(DiscoveryNode node, String action, Throwable cause) { super(node == null ? null : node.name(), node == null ? null : node.address(), action, cause); }
@Override public void run() { try { // -1 means maybe merge engine.optimize(new Engine.Optimize().maxNumSegments(-1).waitForMerge(false)); } catch (EngineClosedException e) { // we are being closed, ignore } catch (OptimizeFaile...
@Override public void run() { try { // -1 means maybe merge engine.optimize(new Engine.Optimize().maxNumSegments(-1).waitForMerge(false).flush(false).refresh(false)); } catch (EngineClosedException e) { // we are being closed, ignore ...
private LoadingImageGetter(final Context context, final int size) { int imageSize = Math.round(context.getResources().getDisplayMetrics().density * 48 + 0.5F); image = context.getResources().getDrawable(drawable.image_loading_icon); image.setBounds(0, 0, imageSize, imageSize)...
private LoadingImageGetter(final Context context, final int size) { int imageSize = Math.round(context.getResources().getDisplayMetrics().density * size + 0.5F); image = context.getResources().getDrawable(drawable.image_loading_icon); image.setBounds(0, 0, imageSize, imageSiz...
public SearchRepositoryListAdapter(LayoutInflater inflater, SearchRepository[] elements) { super(layout.repo_issue_list_item, inflater, elements); }
public SearchRepositoryListAdapter(LayoutInflater inflater, SearchRepository[] elements) { super(layout.repo_list_item, inflater, elements); }
@Override public void snapshot(SnapshotIndexCommit snapshotIndexCommit, Translog.Snapshot translogSnapshot) throws EngineException { lastIndexVersion = snapshotIndexCommit.getVersion(); lastTranslogId = translogSnapshot.translogId(); lastTransl...
@Override public void snapshot(SnapshotIndexCommit snapshotIndexCommit, Translog.Snapshot translogSnapshot) throws EngineException { lastIndexVersion = snapshotIndexCommit.getVersion(); lastTranslogId = translogSnapshot.translogId(); lastTransl...
@Override public void messageReceived(SnapshotWrapper snapshot, TransportChannel channel) throws Exception { if (!snapshot.phase3) { // clean open index outputs in any case (there should not be any open, we close then in the chunk) cleanOpenIndex(); } ...
@Override public void messageReceived(SnapshotWrapper snapshot, TransportChannel channel) throws Exception { if (!snapshot.phase3) { // clean open index outputs in any case (there should not be any open, we close then in the chunk) cleanOpenIndex(); } ...
public Explanation explain(AtomicReaderContext context, int doc) throws IOException { Explanation subQueryExpl = subQueryWeight.explain(context, doc); if (!subQueryExpl.isMatch()) { return subQueryExpl; } // First: Gather explanations for all filt...
public Explanation explain(AtomicReaderContext context, int doc) throws IOException { Explanation subQueryExpl = subQueryWeight.explain(context, doc); if (!subQueryExpl.isMatch()) { return subQueryExpl; } // First: Gather explanations for all filt...
public Explanation explain(AtomicReaderContext context, int doc) throws IOException { Explanation subQueryExpl = subQueryWeight.explain(context, doc); if (!subQueryExpl.isMatch()) { return subQueryExpl; } function.setNextReader(context); ...
public Explanation explain(AtomicReaderContext context, int doc) throws IOException { Explanation subQueryExpl = subQueryWeight.explain(context, doc); if (!subQueryExpl.isMatch()) { return subQueryExpl; } function.setNextReader(context); ...
public Label (CharSequence text, Skin skin, String styleName) { this(text, skin.get(LabelStyle.class)); }
public Label (CharSequence text, Skin skin, String styleName) { this(text, skin.get(styleName, LabelStyle.class)); }
public static VertexAttribute Normal() { return new VertexAttribute(Usage.TextureCoordinates, 3, ShaderProgram.NORMAL_ATTRIBUTE); }
public static VertexAttribute Normal() { return new VertexAttribute(Usage.Normal, 3, ShaderProgram.NORMAL_ATTRIBUTE); }
protected UidFieldMapper(String name, String indexName) { super(new Names(name, indexName, indexName, name), Defaults.BOOST, new FieldType(Defaults.UID_FIELD_TYPE), Lucene.KEYWORD_ANALYZER, Lucene.KEYWORD_ANALYZER); }
protected UidFieldMapper(String name, String indexName) { super(new Names(name, indexName, indexName, name), Defaults.BOOST, new FieldType(Defaults.UID_FIELD_TYPE), Lucene.KEYWORD_ANALYZER, Lucene.KEYWORD_ANALYZER, null); }
protected void update(final int position, final RepositoryHeaderItemView view, final Repository repository) { String headerValue = headers.get(repository.getId()); if (headerValue != null) { view.header.setVisibility(VISIBLE); view.headerText.setText(headerValue);...
protected void update(final int position, final RepositoryHeaderItemView view, final Repository repository) { String headerValue = headers.get(repository.getId()); if (headerValue != null) { view.header.setVisibility(VISIBLE); view.headerText.setText(headerValue);...
protected void update(final int position, final RepositoryItemView view, final SearchRepository repository) { StyledText name = new StyledText(); name.append(repository.getOwner()).append('/'); name.bold(repository.getName()); view.repoName.setText(name); updateD...
protected void update(final int position, final RepositoryItemView view, final SearchRepository repository) { StyledText name = new StyledText(); name.append(repository.getOwner()).append('/'); name.bold(repository.getName()); view.repoName.setText(name); updateD...
protected void update(final int position, final RepositoryItemView view, final Repository repository) { StyledText name = new StyledText(); if (!login.equals(repository.getOwner().getLogin())) { int descriptionColor = view.repoName.getResources().getColor( ...
protected void update(final int position, final RepositoryItemView view, final Repository repository) { StyledText name = new StyledText(); if (!login.equals(repository.getOwner().getLogin())) { int descriptionColor = view.repoName.getResources().getColor( ...
@Inject public ThrottlingNodeAllocation(Settings settings) { super(settings); this.concurrentRecoveries = componentSettings.getAsInt("concurrent_recoveries", Runtime.getRuntime().availableProcessors() + 1); }
@Inject public ThrottlingNodeAllocation(Settings settings) { super(settings); this.concurrentRecoveries = componentSettings.getAsInt("concurrent_recoveries", 2); }
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(fieldName); if (order != null) { builder.field("order", order.toString()); } if (missing != null) { builder.field("missing", missing); } ...
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(fieldName); if (order != null) { builder.field("order", order.toString()); } if (missing != null) { builder.field("missing", missing); } ...
public void setStyle (ButtonStyle style) { if (style == null) throw new IllegalArgumentException("style cannot be null."); this.style = style; setBackground(isPressed ? style.down : style.up); invalidateHierarchy(); }
public void setStyle (ButtonStyle style) { if (style == null) throw new IllegalArgumentException("style cannot be null."); this.style = style; setBackground((isPressed && style.down != null) ? style.down : style.up); invalidateHierarchy(); }
public Array<AssetDescriptor> getDependencies (String fileName, MusicParameter parameter) { return null; } static public class MusicParameter implements AssetLoaderParameters<Music> { }
public Array<AssetDescriptor> getDependencies (String fileName, MusicParameter parameter) { return null; } static public class MusicParameter extends AssetLoaderParameters<Music> { }
public Array<AssetDescriptor> getDependencies (String fileName, PixmapParameter parameter) { return null; } static public class PixmapParameter implements AssetLoaderParameters<Pixmap> { }
public Array<AssetDescriptor> getDependencies (String fileName, PixmapParameter parameter) { return null; } static public class PixmapParameter extends AssetLoaderParameters<Pixmap> { }
public Array<AssetDescriptor> getDependencies (String fileName, SoundParameter parameter) { return null; } static public class SoundParameter implements AssetLoaderParameters<Sound> { }
public Array<AssetDescriptor> getDependencies (String fileName, SoundParameter parameter) { return null; } static public class SoundParameter extends AssetLoaderParameters<Sound> { }
private void recoverIndex(CommitPoint commitPoint, ImmutableMap<String, BlobMetaData> blobs) throws Exception { recoveryStatus.updateStage(RecoveryStatus.Stage.INDEX); int numberOfFiles = 0; long totalSize = 0; int numberOfReusedFiles = 0; long reusedTotalSize = 0; L...
private void recoverIndex(CommitPoint commitPoint, ImmutableMap<String, BlobMetaData> blobs) throws Exception { recoveryStatus.updateStage(RecoveryStatus.Stage.INDEX); int numberOfFiles = 0; long totalSize = 0; int numberOfReusedFiles = 0; long reusedTotalSize = 0; L...
public boolean isDrawing () { return false; }
public boolean isDrawing () { return drawing; }
private static void assertAllRequestsHaveBeenConsumed() { Iterable<TransportService> transportServices = internalCluster().getInstances(TransportService.class); for (TransportService transportService : transportServices) { assertThat(((InterceptingTransportService)transportService).reque...
private static void assertAllRequestsHaveBeenConsumed() { Iterable<TransportService> transportServices = internalCluster().getInstances(TransportService.class); for (TransportService transportService : transportServices) { assertThat(((InterceptingTransportService)transportService).reque...
public Actor hit (float x, float y, boolean touchable) { Actor hit = super.hit(x, y, touchable); if (hit == null && isModal) return this; return hit; }
public Actor hit (float x, float y, boolean touchable) { Actor hit = super.hit(x, y, touchable); if (hit == null && isModal && (!touchable || getTouchable() == Touchable.enabled)) return this; return hit; }
private Body createBox(BodyType type, float width, float height, float density) { BodyDef def = new BodyDef(); def.type = type; Body box = world.createBody(def); PolygonShape poly = new PolygonShape(); poly.setAsBox(width, height); box.createFixture(poly, density); poly.dispose(); return box; }
private void createWorld() { float y1 = 1; //(float)Math.random() * 0.1f + 1; float y2 = y1; for(int i = 0; i < 50; i++) { Body ground = createEdge(BodyType.StaticBody, -50 + i * 2, y1, -50 + i * 2 + 2, y2, 0); y1 = y2; y2 = 1; //(float)Math.random() + 1; } Body box = createBox(BodyType.Stat...
public void onFailure(Throwable e) { if (ExceptionsHelper.unwrapCause(e) instanceof IndexAlreadyExistsException) { // we have the index, do it try { innerExecute(request, listener); } ...
public void onFailure(Throwable e) { if (ExceptionsHelper.unwrapCause(e) instanceof IndexAlreadyExistsException) { // we have the index, do it try { innerExecute(request, listener); } ...
public void onFailure(Throwable e) { if (ExceptionsHelper.unwrapCause(e) instanceof ConnectTransportException) { int i = ++this.i; if (i == nodes.size()) { listener.onFailure(new NoNodeAvailableException()); } else { ...
public void onFailure(Throwable e) { if (ExceptionsHelper.unwrapCause(e) instanceof ConnectTransportException) { int i = ++this.i; if (i == nodes.size()) { listener.onFailure(new NoNodeAvailableException()); } else { ...
public void run() { listener.onResponse(new Response(false)); nodeIndexDeletedAction.remove(nodeIndexDeleteListener); } }); return newClusterStateBuilder().state(currentState)...
public void run() { listener.onResponse(new Response(false)); nodeIndexDeletedAction.remove(nodeIndexDeleteListener); } }); return newClusterStateBuilder().state(currentState)...
public NettyTransport(Settings settings, ThreadPool threadPool, NetworkService networkService, Version version) { super(settings); this.threadPool = threadPool; this.networkService = networkService; this.version = version; if (settings.getAsBoolean("netty.epollBugWorkaround"...
public NettyTransport(Settings settings, ThreadPool threadPool, NetworkService networkService, Version version) { super(settings); this.threadPool = threadPool; this.networkService = networkService; this.version = version; if (settings.getAsBoolean("netty.epollBugWorkaround"...
@Override public FacetCollector parse(String facetName, XContentParser parser, SearchContext context) throws IOException { String field = null; int size = 10; String[] fieldsNames = null; ImmutableSet<String> excluded = ImmutableSet.of(); String regex = null; String ...
@Override public FacetCollector parse(String facetName, XContentParser parser, SearchContext context) throws IOException { String field = null; int size = 10; String[] fieldsNames = null; ImmutableSet<String> excluded = ImmutableSet.of(); String regex = null; String ...
public void draw (SpriteBatch batch, float parentAlpha) { Color fontColor; if (isDisabled && style.disabledFontColor != null) fontColor = style.disabledFontColor; else if (isPressed() && style.downFontColor != null) fontColor = style.downFontColor; else if (isChecked && style.checkedFontColor != null) ...
public void draw (SpriteBatch batch, float parentAlpha) { Color fontColor; if (isDisabled && style.disabledFontColor != null) fontColor = style.disabledFontColor; else if (isPressed() && style.downFontColor != null) fontColor = style.downFontColor; else if (isChecked && style.checkedFontColor != null) ...
public static float distanceLinePoint (Vector2 start, Vector2 end, Vector2 point) { tmp.set(end.x, end.y, 0); float l2 = tmp.sub(start.y, start.y, 0).len2(); if (l2 == 0.0f) // start == end return point.dst(start); tmp.set(point.x, point.y, 0); tmp.sub(start.x, start.y, 0); tmp2.set(end.x, end.y, 0); ...
public static float distanceLinePoint (Vector2 start, Vector2 end, Vector2 point) { tmp.set(end.x, end.y, 0); float l2 = tmp.sub(start.x, start.y, 0).len2(); if (l2 == 0.0f) // start == end return point.dst(start); tmp.set(point.x, point.y, 0); tmp.sub(start.x, start.y, 0); tmp2.set(end.x, end.y, 0); ...
public void render () { if ((dbgTimer += Gdx.graphics.getDeltaTime()) >= 1f) { dbgTimer -= 1f; Gdx.app.log("Test", "FPS: "+Gdx.graphics.getFramesPerSecond()+", binds: "+exclusiveTextures.getBindCount()+", reused: "+exclusiveTextures.getReuseCount()); exclusiveTextures.resetCounts(); } GL20 gl = Gdx.gl20...
public void render () { if ((dbgTimer += Gdx.graphics.getDeltaTime()) >= 1f) { dbgTimer -= 1f; Gdx.app.log("Test", "FPS: "+Gdx.graphics.getFramesPerSecond()+", binds: "+exclusiveTextures.getBindCount()+", reused: "+exclusiveTextures.getReuseCount()); exclusiveTextures.resetCounts(); } GL20 gl = Gdx.gl20...
@Override protected ShardStatus shardOperation(IndexShardStatusRequest request) throws ElasticSearchException { InternalIndexService indexService = (InternalIndexService) indicesService.indexServiceSafe(request.index()); InternalIndexShard indexShard = (InternalIndexShard) indexService.shardSafe(req...
@Override protected ShardStatus shardOperation(IndexShardStatusRequest request) throws ElasticSearchException { InternalIndexService indexService = (InternalIndexService) indicesService.indexServiceSafe(request.index()); InternalIndexShard indexShard = (InternalIndexShard) indexService.shardSafe(req...
public SortedDocValues getOrdinalsValues(String type) { AtomicOrdinalsFieldData atomicFieldData = typeToIds.get(type); if (atomicFieldData != null) { return MultiValueMode.MIN.select(atomicFieldData.getOrdinalsValues(), -1); } else { return DocValues.emptySorted(); ...
public SortedDocValues getOrdinalsValues(String type) { AtomicOrdinalsFieldData atomicFieldData = typeToIds.get(type); if (atomicFieldData != null) { return MultiValueMode.MIN.select(atomicFieldData.getOrdinalsValues()); } else { return DocValues.emptySorted(); ...
public int compare(OrdAndId o1, OrdAndId o2) { if (o1.id < o2.id) { return -1; } if (o1.id == o2.id) { if (o1.ord < o2.ord) { return -1; } if (o1.ord > o2.o...
public int compare(OrdAndId o1, OrdAndId o2) { if (o1.id < o2.id) { return -1; } if (o1.id == o2.id) { if (o1.ord < o2.ord) { return -1; } if (o1.ord > o2.o...
protected void masterOperation(final ClusterStateRequest request, final ClusterState state, ActionListener<ClusterStateResponse> listener) throws ElasticsearchException { ClusterState currentState = clusterService.state(); logger.trace("Serving cluster state request using version {}", currentState.v...
protected void masterOperation(final ClusterStateRequest request, final ClusterState state, ActionListener<ClusterStateResponse> listener) throws ElasticsearchException { ClusterState currentState = clusterService.state(); logger.trace("Serving cluster state request using version {}", currentState.v...
protected boolean matchesIndices(String currentIndex, String... indices) { final String[] concreteIndices = clusterService.state().metaData().concreteIndices(indices, IndicesOptions.IGNORE_UNAVAILABLE_EXPAND_OPEN_ONLY); for (String index : concreteIndices) { if (Regex.simpleMatch(index, ...
protected boolean matchesIndices(String currentIndex, String... indices) { final String[] concreteIndices = clusterService.state().metaData().concreteIndices(indices, IndicesOptions.lenientExpandOpen()); for (String index : concreteIndices) { if (Regex.simpleMatch(index, currentIndex)) {...
public void testMissing() { String json = "{" + "\"user\":\"kimchy\"," + "\"postDate\":\"2013-01-30\"," + "\"message\":\"trying out Elastic Search\"" + "}"; client().prepareIndex("twitter", "tweet").setSource(json).setRefresh(true).execute().actionGet(); SearchResponse search = client().p...
public void testMissing() { String json = "{" + "\"user\":\"kimchy\"," + "\"postDate\":\"2013-01-30\"," + "\"message\":\"trying out Elastic Search\"" + "}"; client().prepareIndex("twitter", "tweet").setSource(json).setRefresh(true).execute().actionGet(); SearchResponse search = client().p...
public void testPercolateMultipleIndicesAndAliases() throws Exception { createIndex("test1", "test2"); ensureGreen(); logger.info("--> registering queries"); for (int i = 1; i <= 10; i++) { String index = i % 2 == 0 ? "test1" : "test2"; client().prepareIndex(...
public void testPercolateMultipleIndicesAndAliases() throws Exception { createIndex("test1", "test2"); ensureGreen(); logger.info("--> registering queries"); for (int i = 1; i <= 10; i++) { String index = i % 2 == 0 ? "test1" : "test2"; client().prepareIndex(...
protected boolean randomizeNumberOfShardsAndReplicas() { return COMPATIBILITY_VERSION.onOrAfter(Version.V_1_2_0); }
protected boolean randomizeNumberOfShardsAndReplicas() { return compatibilityVersion().onOrAfter(Version.V_1_2_0); }
public abstract class HttpRequest extends RestRequest { /* * Licensed to Elasticsearch 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 * the Apache License...
public abstract class HttpRequest extends RestRequest { /* * Licensed to Elasticsearch 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 * the Apache License...
public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception { HttpRequest request = (HttpRequest) e.getMessage(); // the netty HTTP handling always copy over the buffer to its own buffer, either in NioWorker internally // when reading, or using a cumalation buffer...
public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception { HttpRequest request = (HttpRequest) e.getMessage(); // the netty HTTP handling always copy over the buffer to its own buffer, either in NioWorker internally // when reading, or using a cumalation buffer...
protected void configure() { bind(IndicesQueriesRegistry.class).asEagerSingleton(); Multibinder<QueryParser> qpBinders = Multibinder.newSetBinder(binder(), QueryParser.class); for (Class<QueryParser> queryParser : queryParsersClasses) { qpBinders.addBinding().to(queryParser).asE...
protected void configure() { bind(IndicesQueriesRegistry.class).asEagerSingleton(); Multibinder<QueryParser> qpBinders = Multibinder.newSetBinder(binder(), QueryParser.class); for (Class<QueryParser> queryParser : queryParsersClasses) { qpBinders.addBinding().to(queryParser).asE...
@Override public void onCreate (Bundle savedInstanceState) { super.onCreate(savedInstanceState); initialize(new Bouncy(), false, new FillResolutionStrategy(), 16); }
@Override public void onCreate (Bundle savedInstanceState) { super.onCreate(savedInstanceState); initialize(new Bouncy(), false); }
public void actionPerformed (ActionEvent e) { // System.setProperty("apple.awt.fileDialogForDirectories", "true"); // FileDialog dialog = new FileDialog(GdxSetupUI.this, "Choose destination", FileDialog.LOAD); // dialog.setVisible(true); // String name = dialog.getFile(); // String dir = di...
public void actionPerformed (ActionEvent e) { // System.setProperty("apple.awt.fileDialogForDirectories", "true"); // FileDialog dialog = new FileDialog(GdxSetupUI.this, "Choose destination", FileDialog.LOAD); // dialog.setVisible(true); // String name = dialog.getFile(); // String dir = di...
public void onListItemClick(ListView l, View v, int position, long id) { startActivity(ViewIssuesActivity.createIntent(listItems, position)); }
public void onListItemClick(ListView l, View v, int position, long id) { startActivity(ViewIssuesActivity.createIntent(listItems, position - l.getHeaderViewsCount())); }
protected void innerParseCreateField(ParseContext context, List<Field> fields) throws IOException { byte value; float boost = this.boost; if (context.externalValueSet()) { Object externalValue = context.externalValue(); if (externalValue == null) { if ...
protected void innerParseCreateField(ParseContext context, List<Field> fields) throws IOException { byte value; float boost = this.boost; if (context.externalValueSet()) { Object externalValue = context.externalValue(); if (externalValue == null) { if ...
protected void addIntegerFields(ParseContext context, List<Field> fields, int value, float boost) { if (fieldType.indexed() || fieldType.stored()) { CustomIntegerNumericField field = new CustomIntegerNumericField(this, value, fieldType); field.setBoost(boost); fields.add(...
protected void addIntegerFields(ParseContext context, List<Field> fields, int value, float boost) { if (fieldType.indexed() || fieldType.stored()) { CustomIntegerNumericField field = new CustomIntegerNumericField(this, value, fieldType); field.setBoost(boost); fields.add(...
protected void innerParseCreateField(ParseContext context, List<Field> fields) throws IOException { long value; float boost = this.boost; if (context.externalValueSet()) { Object externalValue = context.externalValue(); if (externalValue == null) { if ...
protected void innerParseCreateField(ParseContext context, List<Field> fields) throws IOException { long value; float boost = this.boost; if (context.externalValueSet()) { Object externalValue = context.externalValue(); if (externalValue == null) { if ...
protected void innerParseCreateField(ParseContext context, List<Field> fields) throws IOException { short value; float boost = this.boost; if (context.externalValueSet()) { Object externalValue = context.externalValue(); if (externalValue == null) { if...
protected void innerParseCreateField(ParseContext context, List<Field> fields) throws IOException { short value; float boost = this.boost; if (context.externalValueSet()) { Object externalValue = context.externalValue(); if (externalValue == null) { if...
protected void innerParseCreateField(ParseContext context, List<Field> fields) throws IOException { String ipAsString; if (context.externalValueSet()) { ipAsString = (String) context.externalValue(); if (ipAsString == null) { ipAsString = nullValue; ...
protected void innerParseCreateField(ParseContext context, List<Field> fields) throws IOException { String ipAsString; if (context.externalValueSet()) { ipAsString = (String) context.externalValue(); if (ipAsString == null) { ipAsString = nullValue; ...
protected NodeInfo nodeOperation(NodeInfoRequest nodeRequest) throws ElasticSearchException { NodesInfoRequest request = nodeRequest.request; return nodeService.info(request.settings(), request.os(), request.process(), request.jvm(), request.network(), request.transport(), request.http()); }
protected NodeInfo nodeOperation(NodeInfoRequest nodeRequest) throws ElasticSearchException { NodesInfoRequest request = nodeRequest.request; return nodeService.info(request.settings(), request.os(), request.process(), request.jvm(), request.threadPool(), request.network(), request.transport(), requ...
protected NodeStats nodeOperation(NodeStatsRequest nodeStatsRequest) throws ElasticSearchException { NodesStatsRequest request = nodeStatsRequest.request; return nodeService.stats(request.indices(), request.os(), request.process(), request.jvm(), request.network(), request.transport(), request.http(...
protected NodeStats nodeOperation(NodeStatsRequest nodeStatsRequest) throws ElasticSearchException { NodesStatsRequest request = nodeStatsRequest.request; return nodeService.stats(request.indices(), request.os(), request.process(), request.jvm(), request.threadPool(), request.network(), request.tran...
private boolean canExecute(File file) { try { Method m = File.class.getMethod("canExecute"); return (Boolean)m.invoke(file); } catch (Exception e) { return false; } }
private boolean canExecute(File file) { try { Method m = File.class.getMethod("canWrite"); return (Boolean)m.invoke(file); } catch (Exception e) { return false; } }
public Ordinals build(Settings settings) { final float acceptableOverheadRatio = settings.getAsFloat("acceptable_overhead_ratio", PackedInts.COMPACT); if (numMultiValuedDocs > 0 || MultiOrdinals.significantlySmallerThanSinglePackedOrdinals(maxDoc, numDocsWithValue, getNumOrds())) { // Mu...
public Ordinals build(Settings settings) { final float acceptableOverheadRatio = settings.getAsFloat("acceptable_overhead_ratio", PackedInts.DEFAULT); if (numMultiValuedDocs > 0 || MultiOrdinals.significantlySmallerThanSinglePackedOrdinals(maxDoc, numDocsWithValue, getNumOrds())) { // Mu...
public synchronized IndexShard createShard(int sShardId) throws ElasticSearchException { if (closed) { throw new ElasticSearchIllegalStateException("Can't create shard [" + index.name() + "][" + sShardId + "], closed"); } ShardId shardId = new ShardId(index, sShardId); if...
public synchronized IndexShard createShard(int sShardId) throws ElasticSearchException { if (closed) { throw new ElasticSearchIllegalStateException("Can't create shard [" + index.name() + "][" + sShardId + "], closed"); } ShardId shardId = new ShardId(index, sShardId); if...
public synchronized IndexService createIndex(String sIndexName, Settings settings, String localNodeId) throws ElasticSearchException { if (!lifecycle.started()) { throw new ElasticSearchIllegalStateException("Can't create an index [" + sIndexName + "], node is closed"); } Index i...
public synchronized IndexService createIndex(String sIndexName, Settings settings, String localNodeId) throws ElasticSearchException { if (!lifecycle.started()) { throw new ElasticSearchIllegalStateException("Can't create an index [" + sIndexName + "], node is closed"); } Index i...
@Override public String[] names() { return new String[]{NAME}; }
@Override public String[] names() { return new String[]{NAME, "in"}; }
private void sendPingRequest(int id) { synchronized (sendMutex) { try { HandlesStreamOutput out = BytesStreamOutput.Cached.cachedHandles(); out.writeInt(id); clusterName.writeTo(out); nodesProvider.nodes().localNode().writeTo(out); ...
private void sendPingRequest(int id) { synchronized (sendMutex) { try { HandlesStreamOutput out = BytesStreamOutput.Cached.cachedHandles(); out.writeInt(id); clusterName.writeTo(out); nodesProvider.nodes().localNode().writeTo(out); ...
public static void main(String[] args) throws Exception { // generate C/C++ code new NativeCodeGenerator().generate(); // generate build scripts, for win32 only // custom target for testing purposes BuildTarget win32home = BuildTarget.newDefaultTarget(TargetOs.Windows, false); win32home.compilerPrefix =...
public static void main(String[] args) throws Exception { // generate C/C++ code new NativeCodeGenerator().generate(); // generate build scripts, for win32 only // custom target for testing purposes BuildTarget win32home = BuildTarget.newDefaultTarget(TargetOs.Windows, false); win32home.compilerPrefix =...
public float area () { return MathUtils.PI * (this.width * this.height) / 2; }
public float area () { return MathUtils.PI * (this.width * this.height) / 4; }
public float perimeter () { return 2 * this.width * this.height; }
public float perimeter () { return 2 * (this.width + this.height); }
@Inject public BlobReuseExistingNodeAllocation(Settings settings, IndicesService indicesService, TransportNodesListShardStoreMetaData transportNodesListShardStoreMetaData) { super(settings); this.indicesService = indicesService; this.transpo...
@Inject public BlobReuseExistingNodeAllocation(Settings settings, IndicesService indicesService, TransportNodesListShardStoreMetaData transportNodesListShardStoreMetaData) { super(settings); this.indicesService = indicesService; this.transpo...
public Lookup getLookup(FieldMapper<?> mapper, CompletionSuggestionContext suggestionContext) { AnalyzingSuggestHolder analyzingSuggestHolder = lookupMap.get(mapper.names().fullName()); if (analyzingSuggestHolder == null) { return null; } ...
public Lookup getLookup(FieldMapper<?> mapper, CompletionSuggestionContext suggestionContext) { AnalyzingSuggestHolder analyzingSuggestHolder = lookupMap.get(mapper.names().fullName()); if (analyzingSuggestHolder == null) { return null; } ...
protected ShardFlushRequest newShardRequest(int numShards, ShardRouting shard, FlushRequest request) { return new ShardFlushRequest(shard.index(), shard.id(), request); }
protected ShardFlushRequest newShardRequest(int numShards, ShardRouting shard, FlushRequest request) { return new ShardFlushRequest(shard.shardId(), request); }
protected ShardOptimizeRequest newShardRequest(int numShards, ShardRouting shard, OptimizeRequest request) { return new ShardOptimizeRequest(shard.index(), shard.id(), request); }
protected ShardOptimizeRequest newShardRequest(int numShards, ShardRouting shard, OptimizeRequest request) { return new ShardOptimizeRequest(shard.shardId(), request); }
protected ShardRefreshRequest newShardRequest(int numShards, ShardRouting shard, RefreshRequest request) { return new ShardRefreshRequest(shard.index(), shard.id(), request); }
protected ShardRefreshRequest newShardRequest(int numShards, ShardRouting shard, RefreshRequest request) { return new ShardRefreshRequest(shard.shardId(), request); }
protected ShardValidateQueryRequest newShardRequest(int numShards, ShardRouting shard, ValidateQueryRequest request) { String[] filteringAliases = clusterService.state().metaData().filteringAliases(shard.index(), request.indices()); return new ShardValidateQueryRequest(shard.index(), shard.id(), fil...
protected ShardValidateQueryRequest newShardRequest(int numShards, ShardRouting shard, ValidateQueryRequest request) { String[] filteringAliases = clusterService.state().metaData().filteringAliases(shard.index(), request.indices()); return new ShardValidateQueryRequest(shard.shardId(), filteringAlia...
protected ShardCountRequest newShardRequest(int numShards, ShardRouting shard, CountRequest request) { String[] filteringAliases = clusterService.state().metaData().filteringAliases(shard.index(), request.indices()); return new ShardCountRequest(shard.index(), shard.id(), filteringAliases, request);...
protected ShardCountRequest newShardRequest(int numShards, ShardRouting shard, CountRequest request) { String[] filteringAliases = clusterService.state().metaData().filteringAliases(shard.index(), request.indices()); return new ShardCountRequest(shard.shardId(), filteringAliases, request); }
protected ShardExistsRequest newShardRequest(int numShards, ShardRouting shard, ExistsRequest request) { String[] filteringAliases = clusterService.state().metaData().filteringAliases(shard.index(), request.indices()); return new ShardExistsRequest(shard.index(), shard.id(), filteringAliases, reques...
protected ShardExistsRequest newShardRequest(int numShards, ShardRouting shard, ExistsRequest request) { String[] filteringAliases = clusterService.state().metaData().filteringAliases(shard.index(), request.indices()); return new ShardExistsRequest(shard.shardId(), filteringAliases, request); }
protected PercolateShardRequest newShardRequest(int numShards, ShardRouting shard, PercolateRequest request) { return new PercolateShardRequest(shard.index(), shard.id(), numShards, request); }
protected PercolateShardRequest newShardRequest(int numShards, ShardRouting shard, PercolateRequest request) { return new PercolateShardRequest(shard.shardId(), numShards, request); }
protected ShardSuggestRequest newShardRequest(int numShards, ShardRouting shard, SuggestRequest request) { return new ShardSuggestRequest(shard.index(), shard.id(), request); }
protected ShardSuggestRequest newShardRequest(int numShards, ShardRouting shard, SuggestRequest request) { return new ShardSuggestRequest(shard.shardId(), request); }
@Test public void testBoolFilteredQuery() throws IOException { IndexQueryParser queryParser = queryParser(); String query = copyToStringFromClasspath("/org/elasticsearch/index/query/xcontent/bool-filter.json"); Query parsedQuery = queryParser.parse(query).query(); assertThat(parsedQu...
@Test public void testBoolFilteredQuery() throws IOException { IndexQueryParser queryParser = queryParser(); String query = copyToStringFromClasspath("/org/elasticsearch/index/query/xcontent/bool-filter.json"); Query parsedQuery = queryParser.parse(query).query(); assertThat(parsedQu...
public CheckBox (String text, Skin skin) { this(text, skin.getStyle(CheckBoxStyle.class)); }
public CheckBox (String text, Skin skin) { this(text, skin.get(CheckBoxStyle.class)); }
public ImageButton (Skin skin) { this(skin.getStyle("default", ImageButtonStyle.class)); }
public ImageButton (Skin skin) { this(skin.get(ImageButtonStyle.class)); }
public Label (CharSequence text, Skin skin) { this(text, skin.getStyle(LabelStyle.class)); }
public Label (CharSequence text, Skin skin) { this(text, skin.get(LabelStyle.class)); }
public List (Object[] items, Skin skin) { this(items, skin.getStyle(ListStyle.class)); }
public List (Object[] items, Skin skin) { this(items, skin.get(ListStyle.class)); }
public ScrollPane (Actor widget, Skin skin) { this(widget, skin.getStyle(ScrollPaneStyle.class)); }
public ScrollPane (Actor widget, Skin skin) { this(widget, skin.get(ScrollPaneStyle.class)); }
public SelectBox (Object[] items, Skin skin) { this(items, skin.getStyle(SelectBoxStyle.class)); }
public SelectBox (Object[] items, Skin skin) { this(items, skin.get(SelectBoxStyle.class)); }
public Slider (float min, float max, float steps, Skin skin) { this(min, max, steps, skin.getStyle(SliderStyle.class)); }
public Slider (float min, float max, float steps, Skin skin) { this(min, max, steps, skin.get(SliderStyle.class)); }
public SplitPane (Actor firstWidget, Actor secondWidget, boolean vertical, Skin skin) { this(firstWidget, secondWidget, vertical, skin.getStyle("default-horizontal", SplitPaneStyle.class)); }
public SplitPane (Actor firstWidget, Actor secondWidget, boolean vertical, Skin skin) { this(firstWidget, secondWidget, vertical, skin.get("default-horizontal", SplitPaneStyle.class)); }