Package org.apache.hadoop.hbase.client

Examples of org.apache.hadoop.hbase.client.ClientProtocol.scan()


    }

    ScanResponse.Builder builder = ScanResponse.newBuilder();
    builder.setMoreResults(true);
    builder.addResult(ProtobufUtil.toResult(r));
    Mockito.when(implementation.scan(
      (RpcController)Mockito.any(), (ScanRequest)Mockito.any())).
        thenReturn(builder.build());

    // Get a connection w/ mocked up common methods.
    HConnection connection =
View Full Code Here


    Result r = MetaMockingUtil.getMetaTableRowResult(REGIONINFO, SERVERNAME_A);
    ScanResponse.Builder builder = ScanResponse.newBuilder();
    builder.setMoreResults(true);
    builder.addResult(ProtobufUtil.toResult(r));
    if (enabling) {
      Mockito.when(ri.scan((RpcController) Mockito.any(), (ScanRequest) Mockito.any()))
          .thenReturn(builder.build()).thenReturn(builder.build()).thenReturn(builder.build())
          .thenReturn(builder.build()).thenReturn(builder.build())
          .thenReturn(ScanResponse.newBuilder().setMoreResults(false).build());
    } else {
      Mockito.when(ri.scan((RpcController) Mockito.any(), (ScanRequest) Mockito.any())).thenReturn(
View Full Code Here

      Mockito.when(ri.scan((RpcController) Mockito.any(), (ScanRequest) Mockito.any()))
          .thenReturn(builder.build()).thenReturn(builder.build()).thenReturn(builder.build())
          .thenReturn(builder.build()).thenReturn(builder.build())
          .thenReturn(ScanResponse.newBuilder().setMoreResults(false).build());
    } else {
      Mockito.when(ri.scan((RpcController) Mockito.any(), (ScanRequest) Mockito.any())).thenReturn(
          builder.build());
    }
    // If a get, return the above result too for REGIONINFO
    GetResponse.Builder getBuilder = GetResponse.newBuilder();
    getBuilder.setResult(ProtobufUtil.toResult(r));
View Full Code Here

      final Result [] results = new Result [] {new Result(kvs)};
      ScanResponse.Builder builder = ScanResponse.newBuilder();
      for (Result result: results) {
        builder.addResult(ProtobufUtil.toResult(result));
      }
      Mockito.when(implementation.scan(
        (RpcController)Mockito.any(), (ScanRequest)Mockito.any())).
          thenThrow(new ServiceException("Server not running (1 of 3)")).
          thenThrow(new ServiceException("Server not running (2 of 3)")).
          thenThrow(new ServiceException("Server not running (3 of 3)")).
          thenReturn(ScanResponse.newBuilder().setScannerId(1234567890L).build())
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.