Package voldemort.store.socket

Examples of voldemort.store.socket.SocketDestination


    }

    @Before
    public void setUp() throws Exception {
        this.port = ServerTestUtils.findFreePort();
        this.dest1 = new SocketDestination("localhost", port, RequestFormatType.VOLDEMORT_V1);
        this.dest2 = new SocketDestination("localhost", port + 1, RequestFormatType.VOLDEMORT_V1);
        this.masterStats = new ClientSocketStats("");
        pool = null;
    }
View Full Code Here


                    resource.getSocket().close();
            }

            @Override
            protected SocketDestination getRequestKey() throws Exception {
                return new SocketDestination("localhost", 7666, RequestFormatType.VOLDEMORT_V1);
            }

        };

        // borrow timeout >> doSomething() no timeout expected
View Full Code Here

                        resource.close();
                }

                @Override
                protected SocketDestination getRequestKey() throws Exception {
                    return new SocketDestination("localhost", 7666, RequestFormatType.VOLDEMORT_V1);
                }

            };

            // borrow timeout >> doSomething() no timeout expected
View Full Code Here

     */
    public void close() {
        Iterator<SocketDestination> it = getStatsMap().keySet().iterator();
        while(it.hasNext()) {
            try {
                SocketDestination destination = it.next();
                JmxUtils.unregisterMbean(JmxUtils.createObjectName(JmxUtils.getPackageName(ClientRequestExecutor.class),
                                                                   "stats_"
                                                                           + destination.toString()
                                                                                        .replace(':',
                                                                                                 '_')
                                                                           + identifierString));
            } catch(Exception e) {}
        }
View Full Code Here

        private void sendAdminRequest(VAdminProto.VoldemortAdminRequest adminRequest,
                                      int destinationNodeId) {
            // TODO probably need a helper to do all this, at some point.. all
            // of this file has repeated code
            Node node = AdminClient.this.getAdminClientCluster().getNodeById(destinationNodeId);
            SocketDestination destination = new SocketDestination(node.getHost(),
                                                                  node.getAdminPort(),
                                                                  RequestFormatType.ADMIN_PROTOCOL_BUFFERS);
            SocketAndStreams sands = socketPool.checkout(destination);

            try {
View Full Code Here

                throw new VoldemortException("The destination path (" + destinationDirPath
                                             + ") to store " + storeName + " does not exist");
            }

            Node node = AdminClient.this.getAdminClientCluster().getNodeById(nodeId);
            final SocketDestination destination = new SocketDestination(node.getHost(),
                                                                        node.getAdminPort(),
                                                                        RequestFormatType.ADMIN_PROTOCOL_BUFFERS);
            final SocketAndStreams sands = socketPool.checkout(destination);
            DataOutputStream outputStream = sands.getOutputStream();
            final DataInputStream inputStream = sands.getInputStream();
View Full Code Here

            return sands;
        }

        private <T extends Message.Builder> T sendAndReceive(int nodeId, Message message, T builder) {
            Node node = currentCluster.getNodeById(nodeId);
            SocketDestination destination = new SocketDestination(node.getHost(),
                                                                  node.getAdminPort(),
                                                                  RequestFormatType.ADMIN_PROTOCOL_BUFFERS);
            SocketAndStreams sands = null;
            try {
                sands = getSocketAndStreams(destination);
View Full Code Here

            VAdminProto.VoldemortAdminRequest adminRequest = VAdminProto.VoldemortAdminRequest.newBuilder()
                                                                                              .setRepairJob(repairJobRequest)
                                                                                              .setType(VAdminProto.AdminRequestType.REPAIR_JOB)
                                                                                              .build();
            Node node = AdminClient.this.getAdminClientCluster().getNodeById(nodeId);
            SocketDestination destination = new SocketDestination(node.getHost(),
                                                                  node.getAdminPort(),
                                                                  RequestFormatType.ADMIN_PROTOCOL_BUFFERS);
            SocketAndStreams sands = socketPool.checkout(destination);

            try {
View Full Code Here

                                                                                              .setType(VAdminProto.AdminRequestType.PRUNE_JOB)
                                                                                              .build();
            // TODO probably need a helper to do all this, at some point.. all
            // of this file has repeated code
            Node node = AdminClient.this.getAdminClientCluster().getNodeById(nodeId);
            SocketDestination destination = new SocketDestination(node.getHost(),
                                                                  node.getAdminPort(),
                                                                  RequestFormatType.ADMIN_PROTOCOL_BUFFERS);
            SocketAndStreams sands = socketPool.checkout(destination);

            try {
View Full Code Here

         */
        public Iterator<Pair<ByteArray, Versioned<byte[]>>> fetchOrphanedEntries(int nodeId,
                                                                                 String storeName) {

            Node node = AdminClient.this.getAdminClientCluster().getNodeById(nodeId);
            final SocketDestination destination = new SocketDestination(node.getHost(),
                                                                        node.getAdminPort(),
                                                                        RequestFormatType.ADMIN_PROTOCOL_BUFFERS);
            final SocketAndStreams sands = socketPool.checkout(destination);
            DataOutputStream outputStream = sands.getOutputStream();
            final DataInputStream inputStream = sands.getInputStream();
View Full Code Here

TOP

Related Classes of voldemort.store.socket.SocketDestination

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.