Package io.crate.executor.transport.distributed

Examples of io.crate.executor.transport.distributed.DistributedResultRequest.rows()


        rows[0] = new Object[] {1, new BytesRef("Arthur")};
        rows[1] = new Object[] {2, new BytesRef("Trillian")};
        rows[2] = new Object[] {3, new BytesRef("Marvin")};

        DistributedResultRequest requestSender = new DistributedResultRequest(contextId, streamers);
        requestSender.rows(rows);

        BytesStreamOutput streamOutput = new BytesStreamOutput();
        requestSender.writeTo(streamOutput);
        // -- end sender
View Full Code Here


        Streamer<?>[] streamers = new Streamer[2];
        streamers[0] = DataTypes.INTEGER.streamer();
        streamers[1] = DataTypes.STRING.streamer();

        DistributedResultRequest requestSender = new DistributedResultRequest(contextId, streamers);
        requestSender.rows(rows);

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

        BytesStreamInput streamInput = new BytesStreamInput(streamOutput.bytes());
View Full Code Here

        DistributedResultRequest requestReceiver = new DistributedResultRequest(contextManager);
        requestReceiver.readFrom(streamInput);


        Object[][] receiverRows = requestReceiver.rows();
        for (int i = 0; i < rows.length; i++) {
            assertTrue(Arrays.equals(rows[i], receiverRows[i]));
        }
    }
View Full Code Here

        Iterator<String> iterator = nodes.iterator();
        String firstNode = iterator.next();

        DistributedResultRequest request1 = new DistributedResultRequest(mergeNode.contextId(), mapperOutputStreamer);
        request1.rows(new Object[][] {
                new Object[] { new CountAggregation.CountAggState() {{ value = 1; }}, new BytesRef("bar") },
        });
        DistributedResultRequest request2 = new DistributedResultRequest(mergeNode.contextId(), mapperOutputStreamer);
        request2.rows(new Object[][] {
                new Object[] { new CountAggregation.CountAggState() {{ value = 1; }}, new BytesRef("bar") },
View Full Code Here

        DistributedResultRequest request1 = new DistributedResultRequest(mergeNode.contextId(), mapperOutputStreamer);
        request1.rows(new Object[][] {
                new Object[] { new CountAggregation.CountAggState() {{ value = 1; }}, new BytesRef("bar") },
        });
        DistributedResultRequest request2 = new DistributedResultRequest(mergeNode.contextId(), mapperOutputStreamer);
        request2.rows(new Object[][] {
                new Object[] { new CountAggregation.CountAggState() {{ value = 1; }}, new BytesRef("bar") },
                new Object[] { new CountAggregation.CountAggState() {{ value = 3; }}, new BytesRef("bar") },
                new Object[] { new CountAggregation.CountAggState() {{ value = 3; }}, new BytesRef("foobar") },
        });
View Full Code Here

        transportMergeNodeAction.mergeRows(firstNode, request1, noopListener);
        transportMergeNodeAction.mergeRows(firstNode, request2, noopListener);

        DistributedResultRequest request3 = new DistributedResultRequest(mergeNode.contextId(), mapperOutputStreamer);
        request3.rows(new Object[][] {
                new Object[] { new CountAggregation.CountAggState() {{ value = 10; }}, new BytesRef("foo") },
                new Object[] { new CountAggregation.CountAggState() {{ value = 20; }}, new BytesRef("foo") },
        });
        DistributedResultRequest request4 = new DistributedResultRequest(mergeNode.contextId(), mapperOutputStreamer);
        request4.rows(new Object[][] {
View Full Code Here

        request3.rows(new Object[][] {
                new Object[] { new CountAggregation.CountAggState() {{ value = 10; }}, new BytesRef("foo") },
                new Object[] { new CountAggregation.CountAggState() {{ value = 20; }}, new BytesRef("foo") },
        });
        DistributedResultRequest request4 = new DistributedResultRequest(mergeNode.contextId(), mapperOutputStreamer);
        request4.rows(new Object[][] {
                new Object[] { new CountAggregation.CountAggState() {{ value = 10; }}, new BytesRef("foo") },
                new Object[] { new CountAggregation.CountAggState() {{ value = 14; }}, new BytesRef("test") },
        });

        String secondNode = iterator.next();
View Full Code Here

                        downStreams.size(), Arrays.asList(result));

                int i = 0;
                for (List<Object[]> bucket : bucketingIterator) {
                    DistributedResultRequest request = requests.get(i);
                    request.rows(bucket.toArray(new Object[bucket.size()][]));
                    sendRequest(request, downStreams.get(i));
                    i++;
                }
            }
View Full Code Here

            // send requests
            int i = 0;
            for (List<Object[]> bucket : bucketingIterator) {
                DistributedResultRequest request = this.requests[i];
                request.rows(bucket.toArray(new Object[bucket.size()][]));
                final DiscoveryNode node = downStreams.get(i);
                if (logger.isTraceEnabled()) {
                    logger.trace("[{}] sending distributing collect request to {} ...",
                            jobId.toString(),
                            node.id());
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.