Examples of reset()


Examples of org.elasticsearch.common.geo.GeoPoint.reset()

                final GeoPointValues values = new GeoPointValues() {
                    @Override
                    public GeoPoint get(int docID) {
                        final int ord = singleOrds.getOrd(docID);
                        if (ord >= 0) {
                            point.reset(lat.get(ord), lon.get(ord));
                        }
                        return point;
                    }
                };
                return FieldData.singleton(values, DocValues.docsWithValue(singleOrds, maxDoc));
View Full Code Here

Examples of org.elasticsearch.common.io.FastCharArrayWriter.reset()

        generator.flush();

        assertThat(writer.toStringTrim(), equalTo("{\"test\":\"value\"}"));

        // try again...
        writer.reset();
        generator.writeStartObject();
        generator.writeStringField("test", "value");
        generator.writeEndObject();
        generator.flush();
        // we get a space at the start here since it thinks we are not in the root object (fine, we will ignore it in the real code we use)
View Full Code Here

Examples of org.elasticsearch.common.io.UTF8StreamWriter.reset()

        UTF8StreamWriter writer = (ref == null) ? null : ref.get();
        if (writer == null) {
            writer = new UTF8StreamWriter(1024 * 4);
            utf8StreamWriter.set(new SoftReference<UTF8StreamWriter>(writer));
        }
        writer.reset();
        return writer;
    }
}
View Full Code Here

Examples of org.elasticsearch.common.io.stream.BytesStreamOutput.reset()

        assertArrayEquals(r1.cols(), r2.cols());
        assertArrayEquals(r1.columnTypes(), r2.columnTypes());
        assertArrayEquals(r1.rows(), r2.rows());
        assertEquals(r1.rowCount(), r2.rowCount());

        o.reset();
        r1 = new SQLResponse();
        r1.cols(new String[]{"a", "b"});
        r1.colTypes(new DataType[]{StringType.INSTANCE, StringType.INSTANCE});
        r1.includeTypes(true);
        r1.rows(new Object[][]{new String[]{"va", "vb"}});
View Full Code Here

Examples of org.elasticsearch.common.io.stream.StreamInput.reset()

        assertEquals(pbr.get(0), si.readByte());
        assertEquals(pbr.get(1), si.readByte());
        assertEquals(pbr.get(2), si.readByte());

        // reset the stream for bulk reading
        si.reset();

        // buffer for bulk reads
        byte[] origBuf = new byte[length];
        getRandom().nextBytes(origBuf);
        byte[] targetBuf = Arrays.copyOf(origBuf, origBuf.length);
View Full Code Here

Examples of org.elasticsearch.common.lucene.all.AllEntries.reset()

        Analyzer analyzer = analysisService.analyzer(analyzerName).analyzer();

        AllEntries allEntries = new AllEntries();
        allEntries.addText("field1", text, 1.0f);
        allEntries.reset();

        TokenStream stream = AllTokenStream.allTokenStream("_all", allEntries, analyzer);
        TermAttribute termAtt = stream.addAttribute(TermAttribute.class);

        List<String> terms = new ArrayList<String>();
View Full Code Here

Examples of org.elasticsearch.common.lucene.document.ResetFieldSelector.reset()

                Map<String, GetField> fields = null;
                byte[] source = null;
                UidField.DocIdAndVersion docIdAndVersion = get.docIdAndVersion();
                ResetFieldSelector fieldSelector = buildFieldSelectors(docMapper, gFields);
                if (fieldSelector != null) {
                    fieldSelector.reset();
                    Document doc;
                    try {
                        doc = docIdAndVersion.reader.document(docIdAndVersion.docId, fieldSelector);
                    } catch (IOException e) {
                        throw new ElasticSearchException("Failed to get type [" + type + "] and id [" + id + "]", e);
View Full Code Here

Examples of org.elasticsearch.gateway.Gateway.reset()

        internalCluster().fullRestart(new RestartCallback() {
            @Override
            public Settings onNodeStopped(String nodeName) throws Exception {
                if (node_1.equals(nodeName)) {
                    logger.info("--> deleting the data for the first node");
                    gateway1.reset();
                }
                return null;
            }
        });
View Full Code Here

Examples of org.elasticsearch.index.fieldvisitor.CustomFieldsVisitor.reset()

        assertThat((Long) fieldsVisitor.fields().get("field3").get(0), equalTo(1l));
        assertThat((Long) fieldsVisitor.fields().get("field3").get(1), equalTo(2l));
        assertThat((Long) fieldsVisitor.fields().get("field3").get(2), equalTo(3l));

        // Make sure the doc gets loaded as if it was stored in the new way
        fieldsVisitor.reset();
        searcher.doc(1, fieldsVisitor);
        fieldsVisitor.postProcess(mapper);
        assertThat(fieldsVisitor.fields().size(), equalTo(3));
        assertThat(fieldsVisitor.fields().get("field1").size(), equalTo(1));
        assertThat((Integer) fieldsVisitor.fields().get("field1").get(0), equalTo(1));
View Full Code Here

Examples of org.elasticsearch.index.query.QueryParseContext.reset()

    }

    private void validateAliasFilter(XContentParser parser, IndexQueryParserService indexQueryParserService) throws IOException {
        QueryParseContext context = indexQueryParserService.getParseContext();
        try {
            context.reset(parser);
            context.setAllowUnmappedFields(false);
            context.parseInnerFilter();
        } finally {
            context.reset(null);
            parser.close();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.