Examples of AggregateResponse


Examples of org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateResponse

          public Pair<List<S>, Long> call(AggregateService instance) throws IOException {
            ServerRpcController controller = new ServerRpcController();
            BlockingRpcCallback<AggregateResponse> rpcCallback =
                new BlockingRpcCallback<AggregateResponse>();
            instance.getStd(controller, requestArg, rpcCallback);
            AggregateResponse response = rpcCallback.get();
            if (controller.failedOnException()) {
              throw controller.getFailedOn();
            }
            Pair<List<S>, Long> pair = new Pair<List<S>, Long>(new ArrayList<S>(), 0L);
            if (response.getFirstPartCount() == 0) {
              return pair;
            }
            List<S> list = new ArrayList<S>();
            for (int i = 0; i < response.getFirstPartCount(); i++) {
              ByteString b = response.getFirstPart(i);
              T t = ProtobufUtil.getParsedGenericInstance(ci.getClass(), 4, b);
              S s = ci.getPromotedValueFromProto(t);
              list.add(s);
            }
            pair.setFirst(list);
            ByteBuffer bb = ByteBuffer.allocate(8).put(
                getBytesFromResponse(response.getSecondPart()));
            bb.rewind();
            pair.setSecond(bb.getLong());
            return pair;
          }
        }, stdCallback);
View Full Code Here

Examples of org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateResponse

          public List<S> call(AggregateService instance) throws IOException {
            ServerRpcController controller = new ServerRpcController();
            BlockingRpcCallback<AggregateResponse> rpcCallback =
                new BlockingRpcCallback<AggregateResponse>();
            instance.getMedian(controller, requestArg, rpcCallback);
            AggregateResponse response = rpcCallback.get();
            if (controller.failedOnException()) {
              throw controller.getFailedOn();
            }

            List<S> list = new ArrayList<S>();
            for (int i = 0; i < response.getFirstPartCount(); i++) {
              ByteString b = response.getFirstPart(i);
              T t = ProtobufUtil.getParsedGenericInstance(ci.getClass(), 4, b);
              S s = ci.getPromotedValueFromProto(t);
              list.add(s);
            }
            return list;
View Full Code Here

Examples of org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateResponse

   */
  @Override
  public void getStd(RpcController controller, AggregateRequest request,
      RpcCallback<AggregateResponse> done) {
    InternalScanner scanner = null;
    AggregateResponse response = null;
    try {
      ColumnInterpreter<T, S, P, Q, R> ci = constructColumnInterpreterFromRequest(request);
      S sumVal = null, sumSqVal = null, tempVal = null;
      long rowCountVal = 0l;
      Scan scan = ProtobufUtil.toScan(request.getScan());
View Full Code Here

Examples of org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateResponse

   * the second qualifier (optional) is for weight column.
   */
  @Override
  public void getMedian(RpcController controller, AggregateRequest request,
      RpcCallback<AggregateResponse> done) {
    AggregateResponse response = null;
    InternalScanner scanner = null;
    try {
      ColumnInterpreter<T, S, P, Q, R> ci = constructColumnInterpreterFromRequest(request);
      S sumVal = null, sumWeights = null, tempVal = null, tempWeight = null;
      Scan scan = ProtobufUtil.toScan(request.getScan());
View Full Code Here

Examples of org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateResponse

   */
  @Override
  public void getMax(RpcController controller, AggregateRequest request,
      RpcCallback<AggregateResponse> done) {
    InternalScanner scanner = null;
    AggregateResponse response = null;
    T max = null;
    try {
      ColumnInterpreter<T, S, P, Q, R> ci = constructColumnInterpreterFromRequest(request);
      T temp;
      Scan scan = ProtobufUtil.toScan(request.getScan());
View Full Code Here

Examples of org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateResponse

   * entire column family will be returned.
   */
  @Override
  public void getMin(RpcController controller, AggregateRequest request,
      RpcCallback<AggregateResponse> done) {
    AggregateResponse response = null;
    InternalScanner scanner = null;
    T min = null;
    try {
      ColumnInterpreter<T, S, P, Q, R> ci = constructColumnInterpreterFromRequest(request);
      T temp;
View Full Code Here

Examples of org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateResponse

   * family will be returned.
   */
  @Override
  public void getSum(RpcController controller, AggregateRequest request,
      RpcCallback<AggregateResponse> done) {
    AggregateResponse response = null;
    InternalScanner scanner = null;
    long sum = 0l;
    try {
      ColumnInterpreter<T, S, P, Q, R> ci = constructColumnInterpreterFromRequest(request);
      S sumVal = null;
View Full Code Here

Examples of org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateResponse

   * @throws IOException
   */
  @Override
  public void getRowNum(RpcController controller, AggregateRequest request,
      RpcCallback<AggregateResponse> done) {
    AggregateResponse response = null;
    long counter = 0l;
    List<Cell> results = new ArrayList<Cell>();
    InternalScanner scanner = null;
    try {
      Scan scan = ProtobufUtil.toScan(request.getScan());
View Full Code Here

Examples of org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateResponse

   * type.
   */
  @Override
  public void getAvg(RpcController controller, AggregateRequest request,
      RpcCallback<AggregateResponse> done) {
    AggregateResponse response = null;
    InternalScanner scanner = null;
    try {
      ColumnInterpreter<T, S, P, Q, R> ci = constructColumnInterpreterFromRequest(request);
      S sumVal = null;
      Long rowCountVal = 0l;
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.