Examples of PutCallback


Examples of com.taobao.metamorphosis.server.network.PutCallback

        final MessageStore store = this.mocksControl.createMock(MessageStore.class);
        EasyMock.expect(this.storeManager.getOrCreateMessageStore(this.topic, partition)).andReturn(store);
        final BooleanCommand expectResp =
                new BooleanCommand(HttpStatus.Success, msgId + " " + partition + " " + offset, opaque);
        final AtomicBoolean invoked = new AtomicBoolean(false);
        final PutCallback cb = new PutCallback() {
            @Override
            public void putComplete(final ResponseCommand resp) {
                invoked.set(true);
                if (!expectResp.equals(resp)) {
                    throw new RuntimeException();
View Full Code Here

Examples of com.taobao.metamorphosis.server.network.PutCallback

        final BooleanCommand expectResp =
                new BooleanCommand(
                    HttpStatus.InternalServerError,
                    "Put message to [broker 'meta://localhost:8123'] [partition 'GregorCommandProcessorUnitTest-1'] failed.",
                    request.getOpaque());
        final PutCallback cb = new PutCallback() {

            @Override
            public void putComplete(final ResponseCommand resp) {
                invoked.set(true);
                System.out.println(((BooleanCommand) resp).getErrorMsg());
View Full Code Here

Examples of com.taobao.metamorphosis.server.network.PutCallback

        final BooleanCommand expectResp =
                new BooleanCommand(
                    HttpStatus.InternalServerError,
                    "Put message to [broker 'meta://localhost:8123'] [partition 'GregorCommandProcessorUnitTest-1'] failed.Detail:Mock exception",
                    request.getOpaque());
        final PutCallback cb = new PutCallback() {

            @Override
            public void putComplete(final ResponseCommand resp) {
                invoked.set(true);
                System.out.println(((BooleanCommand) resp).getErrorMsg());
View Full Code Here

Examples of com.taobao.metamorphosis.server.network.PutCallback

            final byte[] data = new byte[dataLength];

            inputStream.read(data);
            this.doResponseHeaders(response, "text/plain");
            final PutCommand putCommand = this.convert2PutCommand(topic, partition, data, flag, checkSum);
            this.commandProcessor.processPutCommand(putCommand, null, new PutCallback() {

                @Override
                public void putComplete(final ResponseCommand resp) {
                    final BooleanCommand responseCommand = (BooleanCommand) resp;
                    response.setStatus(responseCommand.getCode());
View Full Code Here

Examples of com.taobao.metamorphosis.server.network.PutCallback

            @Override
            public void run() {
                final TransactionId xid = request.getTransactionId();
                final SessionContext context = SessionContextHolder.getOrCreateSessionContext(conn, xid);
                try {
                    SyncProcessor.this.processor.processSyncCommand(request, context, new PutCallback() {
                        @Override
                        public void putComplete(final ResponseCommand resp) {
                            RemotingUtils.response(context.getConnection(), resp);
                        }
                    });
View Full Code Here

Examples of com.taobao.metamorphosis.server.network.PutCallback

        EasyMock.expect(this.idWorker.nextId()).andReturn(msgId);
        EasyMock.expect(this.storeManager.getOrCreateMessageStore(this.topic, partition)).andReturn(store);
        final BooleanCommand expectResp =
                new BooleanCommand(HttpStatus.Success, msgId + " " + partition + " " + offset, opaque);
        final AtomicBoolean invoked = new AtomicBoolean(false);
        final PutCallback cb = new PutCallback() {

            @Override
            public void putComplete(final ResponseCommand resp) {
                invoked.set(true);
                if (!expectResp.equals(resp)) {
View Full Code Here

Examples of com.taobao.metamorphosis.server.network.PutCallback

        // Slave is disconnected
        EasyMock.expect(this.remotingClient.isConnected(this.slaveUrl)).andReturn(false);
        final BooleanCommand expectResp =
                new BooleanCommand(HttpStatus.InternalServerError, "Slave is disconnected ", opaque);
        final AtomicBoolean invoked = new AtomicBoolean(false);
        final PutCallback cb = new PutCallback() {

            @Override
            public void putComplete(final ResponseCommand resp) {
                invoked.set(true);
                if (!expectResp.equals(resp)) {
View Full Code Here

Examples of com.taobao.metamorphosis.server.network.PutCallback

                new BooleanCommand(
                    HttpStatus.InternalServerError,
                    "Put message to [slave 'meta://localhost:8124'] [partition 'SamsaCommandProcessorUnitTest-1'] failed",
                    opaque);
        final AtomicBoolean invoked = new AtomicBoolean(false);
        final PutCallback cb = new PutCallback() {

            @Override
            public void putComplete(final ResponseCommand resp) {
                invoked.set(true);
                System.out.println(((BooleanCommand) resp).getErrorMsg());
View Full Code Here

Examples of com.taobao.metamorphosis.server.network.PutCallback

                new BooleanCommand(
                    HttpStatus.InternalServerError,
                    "Put message to [master 'meta://localhost:8123'] [partition 'SamsaCommandProcessorUnitTest-1'] failed",
                    opaque);
        final AtomicBoolean invoked = new AtomicBoolean(false);
        final PutCallback cb = new PutCallback() {

            @Override
            public void putComplete(final ResponseCommand resp) {
                invoked.set(true);
                System.out.println(((BooleanCommand) resp).getErrorMsg());
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.