Package voldemort.store.routed

Examples of voldemort.store.routed.Pipeline


                                                                                                                         failureDetector,
                                                                                                                         1,
                                                                                                                         routingStrategy,
                                                                                                                         aKey,
                                                                                                                         null);
        Pipeline pipeline = new Pipeline(Operation.GET, 10000, TimeUnit.MILLISECONDS);
        pipeline.addEventAction(Event.STARTED, action);
        pipeline.addEvent(Event.STARTED);
        pipeline.execute();

        if(pipelineData.getFatalError() != null)
            throw pipelineData.getFatalError();

        assertEquals(cluster.getNodes().size(), pipelineData.getNodes().size());
View Full Code Here


                                                                                                                         cluster.getNodes()
                                                                                                                                .size() + 1,
                                                                                                                         routingStrategy,
                                                                                                                         aKey,
                                                                                                                         null);
        Pipeline pipeline = new Pipeline(Operation.GET, 10000, TimeUnit.MILLISECONDS);
        pipeline.addEventAction(Event.STARTED, action);
        pipeline.addEvent(Event.STARTED);
        pipeline.execute();

        if(pipelineData.getFatalError() != null)
            throw pipelineData.getFatalError();
        else
            fail();
View Full Code Here

        RoutingStrategy routingStrategy = new ZoneRoutingStrategy(clusterWithZones,
                                                                  storeDef.getZoneReplicationFactor(),
                                                                  storeDef.getReplicationFactor());

        BasicPipelineData<byte[]> pipelineData = new BasicPipelineData<byte[]>();
        Pipeline pipeline = new Pipeline(Operation.PUT, 10000, TimeUnit.MILLISECONDS);

        // PUT with changing zone id
        for(int clusterZoneId = 0; clusterZoneId < clusterWithZones.getNumberOfZones(); clusterZoneId++) {
            pipelineData.setZonesRequired(storeDef.getZoneCountWrites());
            pipeline.addEventAction(Event.STARTED,
                                    new ConfigureNodes<byte[], BasicPipelineData<byte[]>>(pipelineData,
                                                                                          Event.COMPLETED,
                                                                                          failureDetectorWithZones,
                                                                                          storeDef.getRequiredReads(),
                                                                                          routingStrategy,
                                                                                          aKey,
                                                                                          clusterWithZones.getZoneById(clusterZoneId)));
            pipeline.addEvent(Event.STARTED);
            pipeline.execute();

            List<Node> pipelineNodes = pipelineData.getNodes();
            int pipelineNodesIndex = 0;
            List<Integer> proximityList = clusterWithZones.getZoneById(clusterZoneId)
                                                          .getProximityList();

            // Check if returned list is as per the proximity list
            assertEquals(pipelineNodes.get(pipelineNodesIndex++).getZoneId(), clusterZoneId);
            for(; pipelineNodesIndex < pipelineNodes.size(); pipelineNodesIndex++) {
                assertEquals(proximityList.get(pipelineNodesIndex - 1),
                             new Integer(pipelineNodes.get(pipelineNodesIndex).getZoneId()));
            }
        }

        // GET with changing zone requirements
        for(int zoneReq = 0; zoneReq < clusterWithZones.getNumberOfZones(); zoneReq++) {
            pipelineData = new BasicPipelineData<byte[]>();
            pipeline = new Pipeline(Operation.GET, 10000, TimeUnit.MILLISECONDS);
            pipelineData.setZonesRequired(zoneReq);
            pipeline.addEventAction(Event.STARTED,
                                    new ConfigureNodes<byte[], BasicPipelineData<byte[]>>(pipelineData,
                                                                                          Event.COMPLETED,
                                                                                          failureDetectorWithZones,
                                                                                          storeDef.getRequiredReads(),
                                                                                          routingStrategy,
                                                                                          aKey,
                                                                                          clusterWithZones.getZoneById(0)));
            pipeline.addEvent(Event.STARTED);
            pipeline.execute();

            // Check the first few nodes which are from different zones
            int zoneId = 1;
            for(int index = 0; index < zoneReq; index++) {
                assertEquals(pipelineData.getNodes().get(index).getZoneId(), zoneId++);
View Full Code Here

                                                               keys,
                                                               null,
                                                               null,
                                                               null);

        Pipeline pipeline = new Pipeline(Operation.GET, 10000, TimeUnit.MILLISECONDS);
        pipeline.addEventAction(Event.STARTED, action);
        pipeline.addEvent(Event.STARTED);
        pipeline.execute();

        if(pipelineData.getFatalError() != null)
            throw pipelineData.getFatalError();

        for(ByteArray key: keys) {
View Full Code Here

                                                               Arrays.asList(aKey),
                                                               null,
                                                               null,
                                                               null);

        Pipeline pipeline = new Pipeline(Operation.GET, 10000, TimeUnit.MILLISECONDS);
        pipeline.addEventAction(Event.STARTED, action);
        pipeline.addEvent(Event.STARTED);
        pipeline.execute();

        throw pipelineData.getFatalError();
    }
View Full Code Here

                                                                                                                                           Event.COMPLETED,
                                                                                                                                           failureDetector,
                                                                                                                                           1,
                                                                                                                                           routingStrategy,
                                                                                                                                           aKey);
        Pipeline pipeline = new Pipeline(Operation.GET, 10000, TimeUnit.MILLISECONDS);
        pipeline.addEventAction(Event.STARTED, action);
        pipeline.addEvent(Event.STARTED);
        pipeline.execute();

        if(pipelineData.getFatalError() != null)
            throw pipelineData.getFatalError();

        assertEquals(cluster.getNodes().size(), pipelineData.getNodes().size());
View Full Code Here

TOP

Related Classes of voldemort.store.routed.Pipeline

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.