Package org.apache.hadoop.hbase.client

Examples of org.apache.hadoop.hbase.client.Put.addImmutable()


      if (null == valueToPutCell) {
        return Response.status(Response.Status.BAD_REQUEST)
          .type(MIMETYPE_TEXT).entity("Bad request" + CRLF)
          .build();
      }
      put.addImmutable(valueToPutParts[0], valueToPutParts[1], valueToPutCell
        .getTimestamp(), valueToPutCell.getValue());

      table = servlet.getTable(this.tableResource.getName());
      boolean retValue = table.checkAndPut(key, valueToPutParts[0],
        valueToPutParts[1], valueToCheckCell.getValue(), put);
View Full Code Here


          if (parts.length != 2) {
            return Response.status(Response.Status.BAD_REQUEST)
              .type(MIMETYPE_TEXT).entity("Bad request" + CRLF)
              .build();
          }
          put.addImmutable(parts[0], parts[1], cell.getTimestamp(), cell.getValue());
        }
        puts.add(put);
        if (LOG.isDebugEnabled()) {
          LOG.debug("PUT " + put.toString());
        }
View Full Code Here

      if (parts.length != 2) {
        return Response.status(Response.Status.BAD_REQUEST)
          .type(MIMETYPE_TEXT).entity("Bad request" + CRLF)
          .build();
      }
      put.addImmutable(parts[0], parts[1], timestamp, message);
      table = servlet.getTable(tableResource.getName());
      table.put(put);
      if (LOG.isDebugEnabled()) {
        LOG.debug("PUT " + put.toString());
      }
View Full Code Here

        if (valueToPutCell == null) {
          servlet.getMetrics().incrementFailedPutRequests(1);
          return Response.status(Response.Status.BAD_REQUEST).type(MIMETYPE_TEXT)
              .entity("Bad request: The column to put and check do not match." + CRLF).build();
        } else {
          put.addImmutable(valueToPutParts[0], valueToPutParts[1], valueToPutCell.getTimestamp(),
            valueToPutCell.getValue());
          retValue = table.checkAndPut(key, valueToPutParts[0], valueToPutParts[1],
            valueToCheckCell.getValue(), put);
        }
      } else {
View Full Code Here

  throws IOException {
    Put put = null;
    if (favoredNodeList != null) {
      put = MetaTableAccessor.makePutFromRegionInfo(regionInfo);
      byte[] favoredNodes = getFavoredNodes(favoredNodeList);
      put.addImmutable(HConstants.CATALOG_FAMILY, FAVOREDNODES_QUALIFIER,
          EnvironmentEdgeManager.currentTime(), favoredNodes);
      LOG.info("Create the region " + regionInfo.getRegionNameAsString() +
          " with favored nodes " + Bytes.toString(favoredNodes));
    }
    return put;
View Full Code Here

  public OperationStatus[] setAuths(byte[] user, List<byte[]> authLabels) throws IOException {
    assert labelsRegion != null;
    OperationStatus[] finalOpStatus = new OperationStatus[authLabels.size()];
    Put p = new Put(user);
    for (byte[] auth : authLabels) {
      p.addImmutable(LABELS_TABLE_FAMILY, auth, DUMMY_VALUE);
    }
    this.labelsRegion.put(p);
    // This is a testing impl and so not doing any caching
    for (int i = 0; i < authLabels.size(); i++) {
      finalOpStatus[i] = new OperationStatus(OperationStatusCode.SUCCESS);
View Full Code Here

      for (String superUser : superUsers) {
        byte[] user = Bytes.toBytes(superUser);
        List<String> auths = this.getAuths(user, true);
        if (auths == null || auths.isEmpty()) {
          Put p = new Put(user);
          p.addImmutable(LABELS_TABLE_FAMILY, Bytes.toBytes(SYSTEM_LABEL), DUMMY_VALUE);
          labelsRegion.put(p);
        }
      }
    }
  }
View Full Code Here

            if(qv.hasDeleteType()) {
              byte[] qual = qv.hasQualifier() ? qv.getQualifier().toByteArray() : null;
              put.add(new KeyValue(proto.getRow().toByteArray(), family, qual, ts,
                  fromDeleteType(qv.getDeleteType()), null, tags));
            } else {
              put.addImmutable(family, qualifier, ts, value, tagArray);
            }
          } else {
            if(qv.hasDeleteType()) {
              byte[] qual = qv.hasQualifier() ? qv.getQualifier().toByteArray() : null;
              put.add(new KeyValue(proto.getRow().toByteArray(), family, qual, ts,
View Full Code Here

            if(qv.hasDeleteType()) {
              byte[] qual = qv.hasQualifier() ? qv.getQualifier().toByteArray() : null;
              put.add(new KeyValue(proto.getRow().toByteArray(), family, qual, ts,
                  fromDeleteType(qv.getDeleteType())));
            } else{
              put.addImmutable(family, qualifier, ts, value);
            }
          }
        }
      }
    }
View Full Code Here

  protected void addSystemLabel(HRegion region, Map<String, Integer> labels,
      Map<String, List<Integer>> userAuths) throws IOException {
    if (!labels.containsKey(SYSTEM_LABEL)) {
      Put p = new Put(Bytes.toBytes(SYSTEM_LABEL_ORDINAL));
      p.addImmutable(LABELS_TABLE_FAMILY, LABEL_QUALIFIER, Bytes.toBytes(SYSTEM_LABEL));
      // Set auth for "system" label for all super users.
      List<String> superUsers = getSystemAndSuperUsers();
      for (String superUser : superUsers) {
        p.addImmutable(LABELS_TABLE_FAMILY, Bytes.toBytes(superUser), DUMMY_VALUE,
            LABELS_TABLE_TAGS);
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.