Examples of ByteString


Examples of com.google.protobuf.ByteString

    @Override
    public Object[] getGroup() {
       long ts300=(this.ts/300)*300000;
       Date d= new Date(ts300);
      
       ByteString agent=pvlog.getUserAgent();

       String channel = String.valueOf(agent==null?"":agent.toStringUtf8()).toLowerCase();
        if (channel.indexOf("android") >= 0) {
          channel = "android";
        } else if (channel.indexOf("iphone") >= 0||channel.indexOf("ios") >= 0) {
          channel = "ios";
        } else {
View Full Code Here

Examples of com.google.protobuf.ByteString

    Ct.SignedEntry.Builder signedEntryBuilder = Ct.SignedEntry.newBuilder();
    if (entryType == Ct.LogEntryType.X509_ENTRY_VALUE) {

      int length = (int) readNumber(in, 3);
      ByteString x509 = ByteString.copyFrom(readFixedLength(in, length));
      signedEntryBuilder.setX509(x509);

    } else if (entryType == Ct.LogEntryType.PRECERT_ENTRY_VALUE) {
      Ct.PreCert.Builder preCertBuilder = Ct.PreCert.newBuilder();
View Full Code Here

Examples of com.google.protobuf.ByteString

    headerBuilder.setMethodName("foo");

    GetRequest.Builder getRequestBuilder = GetRequest.newBuilder();
    RegionSpecifier.Builder regionSpecifierBuilder = RegionSpecifier.newBuilder();
    regionSpecifierBuilder.setType(RegionSpecifierType.REGION_NAME);
    ByteString name = ByteString.copyFrom(HRegionInfo.FIRST_META_REGIONINFO.getRegionName());
    regionSpecifierBuilder.setValue(name);
    RegionSpecifier regionSpecifier = regionSpecifierBuilder.build();
    getRequestBuilder.setRegion(regionSpecifier);
    Get.Builder getBuilder = Get.newBuilder();
    getBuilder.setRow(ByteString.copyFrom("somerow".getBytes()));
View Full Code Here

Examples of com.google.protobuf.ByteString

      uuidBuilder.setMostSigBits(clusterId.getMostSignificantBits());
      builder.addClusterIds(uuidBuilder.build());
    }
    if (scopes != null) {
      for (Map.Entry<byte[], Integer> e : scopes.entrySet()) {
        ByteString family = (compressionContext == null) ? ByteString.copyFrom(e.getKey())
            : compressor.compress(e.getKey(), compressionContext.familyDict);
        builder.addScopes(FamilyScope.newBuilder()
            .setFamily(family).setScopeType(ScopeType.valueOf(e.getValue())));
      }
    }
View Full Code Here

Examples of com.google.protobuf.ByteString

    try {
      RollWALWriterResponse response = admin.rollWALWriter(null, request);
      int regionCount = response.getRegionToFlushCount();
      byte[][] regionsToFlush = new byte[regionCount][];
      for (int i = 0; i < regionCount; i++) {
        ByteString region = response.getRegionToFlush(i);
        regionsToFlush[i] = region.toByteArray();
      }
      return regionsToFlush;
    } catch (ServiceException se) {
      throw ProtobufUtil.getRemoteException(se);
    }
View Full Code Here

Examples of com.google.protobuf.ByteString

    return new BlocksWithLocations(ret);
  }

  public static BlockKeyProto convert(BlockKey key) {
    byte[] encodedKey = key.getEncodedKey();
    ByteString keyBytes = ByteString.copyFrom(encodedKey == null ?
        DFSUtil.EMPTY_BYTES : encodedKey);
    return BlockKeyProto.newBuilder().setKeyId(key.getKeyId())
        .setKeyBytes(keyBytes).setExpiryDate(key.getExpiryDate()).build();
  }
View Full Code Here

Examples of com.google.protobuf.ByteString

      return null;
    }
    int snapshotNumber = status.getSnapshotNumber();
    int snapshotQuota = status.getSnapshotQuota();
    byte[] parentFullPath = status.getParentFullPath();
    ByteString parentFullPathBytes = ByteString.copyFrom(
        parentFullPath == null ? DFSUtil.EMPTY_BYTES : parentFullPath);
    HdfsFileStatusProto fs = convert(status.getDirStatus());
    SnapshottableDirectoryStatusProto.Builder builder =
        SnapshottableDirectoryStatusProto
        .newBuilder().setSnapshotNumber(snapshotNumber)
View Full Code Here

Examples of com.google.protobuf.ByteString

  public static SnapshotDiffReportEntryProto convert(DiffReportEntry entry) {
    if (entry == null) {
      return null;
    }
    byte[] fullPath = entry.getRelativePath();
    ByteString fullPathString = ByteString
        .copyFrom(fullPath == null ? DFSUtil.EMPTY_BYTES : fullPath);
   
    String modification = entry.getType().getLabel();
   
    SnapshotDiffReportEntryProto entryProto = SnapshotDiffReportEntryProto
View Full Code Here

Examples of com.google.protobuf.ByteString

        // Check if the connection to the server was done successfully.
        if (!future.isSuccess()) {
            logger.error("Error connecting to host: " + host);
            // If we were not able to connect to the host, it could be down.
            ByteString hostString = ByteString.copyFromUtf8(HedwigSocketAddress.sockAddrStr(host));
            if (pubSubData.connectFailedServers != null && pubSubData.connectFailedServers.contains(hostString)) {
                // We've already tried to connect to this host before so just
                // invoke the operationFailed callback.
                logger.error("Error connecting to host more than once so just invoke the operationFailed callback!");
                pubSubData.callback.operationFailed(pubSubData.context, new CouldNotConnectException(
View Full Code Here

Examples of com.google.protobuf.ByteString

        assertTrue(queue.take());
    }

    @Test
    public void testMultipleAsyncPublish() throws Exception {
        ByteString topic1 = ByteString.copyFromUtf8("myFirstTopic");
        ByteString topic2 = ByteString.copyFromUtf8("myNewTopic");

        publisher.asyncPublish(topic1, Message.newBuilder().setBody(ByteString.copyFromUtf8("Hello World!")).build(),
                               new TestCallback(), null);
        assertTrue(queue.take());
        publisher.asyncPublish(topic2, Message.newBuilder().setBody(ByteString.copyFromUtf8("Hello on new topic!"))
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.