Examples of asReadOnlyByteBuffer()


Examples of com.google.appengine.repackaged.com.google.protobuf.ByteString.asReadOnlyByteBuffer()

        protected V computeNext() {
          if (!iter.hasNext()) {
            return endOfData();
          }
          ByteString next = iter.next();
          return valueMarshaller.fromBytes(next.asReadOnlyByteBuffer());
        }
      };
    }
  }
View Full Code Here

Examples of com.google.protobuf.ByteString.asReadOnlyByteBuffer()

        bc.b.rewind();
        assertEquals(expected, bc.b.getInt());
        bc.b.rewind();
       
        ByteString bs = ByteString.copyFrom(b);
        ByteBuffer bs_b = bs.asReadOnlyByteBuffer();
//        System.err.println("NEW: " + StringUtil.md5sum(b));
       
        assertEquals(expected, bs_b.getInt());
    }
   
View Full Code Here

Examples of com.google.protobuf.ByteString.asReadOnlyByteBuffer()

        // to do it for local work
        ParameterSet parameterSets[] = new ParameterSet[request.getParamsCount()]; // TODO: Cache!
        for (int i = 0; i < parameterSets.length; i++) {
            ByteString paramData = request.getParams(i);
            if (paramData != null && paramData.isEmpty() == false) {
                final FastDeserializer fds = new FastDeserializer(paramData.asReadOnlyByteBuffer());
                if (trace.val)
                    LOG.trace(String.format("Txn #%d paramData[%d] => %s",
                              txn_id, i, fds.buffer()));
                try {
                    parameterSets[i] = fds.readObject(ParameterSet.class);
View Full Code Here

Examples of com.google.protobuf.ByteString.asReadOnlyByteBuffer()

                String msg = String.format("%s input dependency %d is empty", ts, input_dep_id);
                LOG.warn(msg + "\n" + request);
                throw new ServerFaultException(msg, txn_id);
            }
           
            if (fds == null) fds = new FastDeserializer(data.asReadOnlyByteBuffer());
            else fds.setBuffer(data.asReadOnlyByteBuffer());

            vt = null;
            try {
                vt = fds.readObject(VoltTable.class);
View Full Code Here

Examples of com.google.protobuf.ByteString.asReadOnlyByteBuffer()

                LOG.warn(msg + "\n" + request);
                throw new ServerFaultException(msg, txn_id);
            }
           
            if (fds == null) fds = new FastDeserializer(data.asReadOnlyByteBuffer());
            else fds.setBuffer(data.asReadOnlyByteBuffer());

            vt = null;
            try {
                vt = fds.readObject(VoltTable.class);
            } catch (Exception ex) {
View Full Code Here

Examples of com.google.protobuf.ByteString.asReadOnlyByteBuffer()

                          result.getPartitionId(), ts));
            int depId = result.getDepId(i);
            ByteString bs = result.getDepData(i);
            VoltTable vt = null;
            if (bs.isEmpty() == false) {
                FastDeserializer fd = new FastDeserializer(bs.asReadOnlyByteBuffer());
                try {
                    vt = fd.readObject(VoltTable.class);
                    if (trace.val)
                        LOG.trace(String.format("Displaying results from partition %d for %s :: \n %s",
                                  result.getPartitionId(), ts, vt.toString()));                   
View Full Code Here

Examples of com.google.protobuf.ByteString.asReadOnlyByteBuffer()

        for (int i = 0; i < partitionResult.getDepDataCount(); i++) {
            assertEquals(dep_id, partitionResult.getDepId(i));
           
            ByteString bs = partitionResult.getDepData(i);
            assertFalse(bs.isEmpty());
            System.err.println("SIZE: " + StringUtil.md5sum(bs.asReadOnlyByteBuffer()));
           
            byte serialized[] = bs.toByteArray();
            VoltTable clone = FastDeserializer.deserialize(serialized, VoltTable.class);
            assertNotNull(clone);
            assertEquals(vt.getRowCount(), clone.getRowCount());
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.