Package org.elasticsearch.common.io.stream

Examples of org.elasticsearch.common.io.stream.BytesStreamInput



        BytesStreamOutput out = new BytesStreamOutput();
        cn.writeTo(out);

        BytesStreamInput in = new BytesStreamInput(out.bytes());
        CollectNode cn2 = new CollectNode();
        cn2.readFrom(in);
        assertEquals(cn, cn2);

        assertEquals(cn.toCollect(), cn2.toCollect());
View Full Code Here


        cn.jobId(UUID.randomUUID());

        BytesStreamOutput out = new BytesStreamOutput();
        cn.writeTo(out);

        BytesStreamInput in = new BytesStreamInput(out.bytes());
        CollectNode cn2 = new CollectNode();
        cn2.readFrom(in);
        assertEquals(cn, cn2);

        assertEquals(cn.toCollect(), cn2.toCollect());
View Full Code Here

        BytesStreamOutput output = new BytesStreamOutput();
        node.writeTo(output);


        BytesStreamInput input = new BytesStreamInput(output.bytes());
        MergeNode node2 = new MergeNode();
        node2.readFrom(input);

        assertThat(node.numUpstreams(), is(node2.numUpstreams()));
        assertThat(node.executionNodes(), is(node2.executionNodes()));
View Full Code Here

        p.outputs(ImmutableList.<Symbol>of(new Value(DataTypes.BOOLEAN), new Value(DataTypes.INTEGER)));

        BytesStreamOutput out = new BytesStreamOutput();
        Projection.toStream(p, out);

        BytesStreamInput in = new BytesStreamInput(out.bytes());
        TopNProjection p2 = (TopNProjection) Projection.fromStream(in);
        assertEquals(p, p2);
    }
View Full Code Here

        p.values(ImmutableList.<Aggregation>of());

        BytesStreamOutput out = new BytesStreamOutput();
        Projection.toStream(p, out);

        BytesStreamInput in = new BytesStreamInput(out.bytes());
        GroupProjection p2 = (GroupProjection) Projection.fromStream(in);

        assertEquals(p, p2);
    }
View Full Code Here

        BytesStreamOutput out = new BytesStreamOutput();
        Projection.toStream(groupProjection, out);


        BytesStreamInput in = new BytesStreamInput(out.bytes());
        GroupProjection p2 = (GroupProjection) Projection.fromStream(in);

        assertThat(p2.keys.size(), is(1));
        assertThat(p2.values().size(), is(1));
    }
View Full Code Here

        p.values(ImmutableList.<Aggregation>of());
        p.setRequiredGranularity(RowGranularity.SHARD);
        BytesStreamOutput out = new BytesStreamOutput();
        Projection.toStream(p, out);

        BytesStreamInput in = new BytesStreamInput(out.bytes());
        GroupProjection p2 = (GroupProjection) Projection.fromStream(in);
        assertEquals(p, p2);
    }
View Full Code Here

        p.query(TestingHelpers.createFunction(AndOperator.NAME, DataTypes.BOOLEAN, Literal.newLiteral(true), Literal.newLiteral(false)));

        BytesStreamOutput out = new BytesStreamOutput();
        Projection.toStream(p, out);

        BytesStreamInput in = new BytesStreamInput(out.bytes());
        FilterProjection p2 = (FilterProjection) Projection.fromStream(in);

        assertEquals(p, p2);
    }
View Full Code Here

        BytesStreamOutput streamOutput = new BytesStreamOutput();
        state.writeTo(streamOutput);

        AggregationState newState = impl.newState();
        newState.readFrom(new BytesStreamInput(streamOutput.bytes()));
        assertEquals(state.value(), newState.value());
    }
View Full Code Here

        ArrayType arrayType = new ArrayType(new ArrayType(StringType.INSTANCE));
        BytesStreamOutput out = new BytesStreamOutput();

        DataTypes.toStream(arrayType, out);

        BytesStreamInput in = new BytesStreamInput(out.bytes());

        DataType readType = DataTypes.fromStream(in);
        assertThat(readType, instanceOf(ArrayType.class));

        ArrayType readArrayType = (ArrayType)readType;
View Full Code Here

TOP

Related Classes of org.elasticsearch.common.io.stream.BytesStreamInput

Copyright © 2018 www.massapicom. 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.