- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {ArrayList a =
new ArrayList<String>()
new ArrayList()
new ArrayList<Object>()
- Smart code suggestions by Codota
}
if (method.getService() == ClientService.getDescriptor()) { switch(method.getIndex()) { case 0: assert "Get".equals(method.getName()); getTracker.updateRpc(stats); return; case 1: assert "Mutate".equals(method.getName()); final MutationType mutationType = ((MutateRequest) param).getMutation().getMutateType(); switch(mutationType) { assert "Scan".equals(method.getName()); scanTracker.updateRpc(stats); return; case 3: assert "BulkLoadHFile".equals(method.getName()); assert "PrepareBulkLoad".equals(method.getName()); assert "CleanupBulkLoad".equals(method.getName()); assert "ExecService".equals(method.getName()); assert "ExecRegionServerService".equals(method.getName()); assert "Multi".equals(method.getName()); numActionsPerServerHist.update(stats.getNumActionsPerServer()); multiTracker.updateRpc(stats); return;
protected String getCallMethod(final CallRunner task) { RpcCall call = task.getRpcCall(); if (call != null && call.getMethod() != null) { return call.getMethod().getName(); } return null; } }
MethodDescriptor md = call.getMethod(); Message param = call.getParam(); status.setRPC(md.getName(), new Object[]{param}, call.getReceiveTime()); md.getName(), md.getName() + "(" + param.getClass().getName() + ")", (tooLarge ? "TooLarge" : "TooSlow"), status.getClient(), startTime, processingTime, qTime,
String methodName = (call.getMethod() != null) ? call.getMethod().getName() : ""; String traceString = serviceName + "." + methodName; TraceUtil.createTrace(traceString);
org.apache.hbase.thirdparty.com.google.protobuf.RpcCallback< org.apache.hbase.thirdparty.com.google.protobuf.Message> done) { if (method.getService() != getDescriptor()) { throw new java.lang.IllegalArgumentException( "Service.callMethod() given method descriptor for wrong " + "service type."); switch(method.getIndex()) { case 0: this.getRegionInfo(controller, (org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetRegionInfoRequest)request,
public final org.apache.hbase.thirdparty.com.google.protobuf.Message getResponsePrototype( org.apache.hbase.thirdparty.com.google.protobuf.Descriptors.MethodDescriptor method) { if (method.getService() != getDescriptor()) { throw new java.lang.IllegalArgumentException( "Service.getResponsePrototype() given method " + "descriptor for wrong service type."); switch(method.getIndex()) { case 0: return org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetRegionInfoResponse.getDefaultInstance();
@Override public String toString() { return "callId: " + this.id + " methodName: " + this.md.getName() + " param {" + (this.param != null ? ProtobufUtil.getShortTextFormat(this.param) : "") + "}"; }
static RequestHeader buildRequestHeader(Call call, CellBlockMeta cellBlockMeta) { RequestHeader.Builder builder = RequestHeader.newBuilder(); builder.setCallId(call.id); //TODO handle htrace API change, see HBASE-18895 /*if (call.span != null) { builder.setTraceInfo(RPCTInfo.newBuilder().setParentId(call.span.getSpanId()) .setTraceId(call.span.getTracerId())); }*/ builder.setMethodName(call.md.getName()); builder.setRequestParam(call.param != null); if (cellBlockMeta != null) { builder.setCellBlockMeta(cellBlockMeta); } // Only pass priority if there is one set. if (call.priority != HConstants.PRIORITY_UNSET) { builder.setPriority(call.priority); } builder.setTimeout(call.timeout); return builder.build(); }
private void onCallFinished(Call call, HBaseRpcController hrc, InetSocketAddress addr, RpcCallback<Message> callback) { call.callStats.setCallTimeMs(EnvironmentEdgeManager.currentTime() - call.getStartTime()); if (metrics != null) { metrics.updateRpc(call.md, call.param, call.callStats); } if (LOG.isTraceEnabled()) { LOG.trace( "Call: " + call.md.getName() + ", callTime: " + call.callStats.getCallTimeMs() + "ms"); } if (call.error != null) { if (call.error instanceof RemoteException) { call.error.fillInStackTrace(); hrc.setFailed(call.error); } else { hrc.setFailed(wrapException(addr, call.error)); } callback.run(null); } else { hrc.setDone(call.cells); callback.run(call.response); } }
private void callMethod(final Descriptors.MethodDescriptor md, final HBaseRpcController hrc, final Message param, Message returnType, final User ticket, final InetSocketAddress addr, final RpcCallback<Message> callback) { final MetricsConnection.CallStats cs = MetricsConnection.newCallStats(); cs.setStartTime(EnvironmentEdgeManager.currentTime()); final AtomicInteger counter = concurrentCounterCache.getUnchecked(addr); Call call = new Call(nextCallId(), md, param, hrc.cellScanner(), returnType, hrc.getCallTimeout(), hrc.getPriority(), new RpcCallback<Call>() { @Override public void run(Call call) { counter.decrementAndGet(); onCallFinished(call, hrc, addr, callback); } }, cs); ConnectionId remoteId = new ConnectionId(ticket, md.getService().getName(), addr); int count = counter.incrementAndGet(); try { if (count > maxConcurrentCallsPerServer) { throw new ServerTooBusyException(addr, count); } cs.setConcurrentCallsPerServer(count); T connection = getConnection(remoteId); connection.sendRequest(call, hrc); } catch (Exception e) { call.setException(toIOE(e)); } }
if (method.getService() == ClientService.getDescriptor()) { switch(method.getIndex()) { case 0: assert "Get".equals(method.getName()); getTracker.updateRpc(stats); return; case 1: assert "Mutate".equals(method.getName()); final MutationType mutationType = ((MutateRequest) param).getMutation().getMutateType(); switch(mutationType) { assert "Scan".equals(method.getName()); scanTracker.updateRpc(stats); return; case 3: assert "BulkLoadHFile".equals(method.getName()); assert "PrepareBulkLoad".equals(method.getName()); assert "CleanupBulkLoad".equals(method.getName()); assert "ExecService".equals(method.getName()); assert "ExecRegionServerService".equals(method.getName()); assert "Multi".equals(method.getName()); multiTracker.updateRpc(stats); return; default:
public final org.apache.hbase.thirdparty.com.google.protobuf.Message getRequestPrototype( org.apache.hbase.thirdparty.com.google.protobuf.Descriptors.MethodDescriptor method) { if (method.getService() != getDescriptor()) { throw new java.lang.IllegalArgumentException( "Service.getRequestPrototype() given method " + "descriptor for wrong service type."); switch(method.getIndex()) { case 0: return org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetRegionInfoRequest.getDefaultInstance();
/** Update call stats for non-critical-path methods */ private void updateRpcGeneric(MethodDescriptor method, CallStats stats) { final String methodName = method.getService().getName() + "_" + method.getName(); getMetric(DRTN_BASE + methodName, rpcTimers, timerFactory) .update(stats.getCallTimeMs(), TimeUnit.MILLISECONDS); getMetric(REQ_BASE + methodName, rpcHistograms, histogramFactory) .update(stats.getRequestSizeBytes()); getMetric(RESP_BASE + methodName, rpcHistograms, histogramFactory) .update(stats.getResponseSizeBytes()); }
public final org.apache.hbase.thirdparty.com.google.protobuf.Message getRequestPrototype( org.apache.hbase.thirdparty.com.google.protobuf.Descriptors.MethodDescriptor method) { if (method.getService() != getDescriptor()) { throw new java.lang.IllegalArgumentException( "Service.getRequestPrototype() given method " + "descriptor for wrong service type."); switch(method.getIndex()) { case 0: return org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetRegionInfoRequest.getDefaultInstance();
@Override public String toString() { return "callId: " + this.id + " methodName: " + this.md.getName() + " param {" + (this.param != null ? ProtobufUtil.getShortTextFormat(this.param) : "") + "}"; }
org.apache.hbase.thirdparty.com.google.protobuf.Message request) throws org.apache.hbase.thirdparty.com.google.protobuf.ServiceException { if (method.getService() != getDescriptor()) { throw new java.lang.IllegalArgumentException( "Service.callBlockingMethod() given method descriptor for " + "wrong service type."); switch(method.getIndex()) { case 0: return impl.getRegionInfo(controller, (org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetRegionInfoRequest)request);
@Override public Message callBlockingMethod(MethodDescriptor md, org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, Message param) throws org.apache.hbase.thirdparty.com.google.protobuf.ServiceException { com.google.protobuf.Descriptors.MethodDescriptor methodDescriptor = service.getDescriptorForType().findMethodByName(md.getName()); com.google.protobuf.Message request = service.getRequestPrototype(methodDescriptor); // TODO: Convert rpcController com.google.protobuf.Message response = null; try { response = service.callBlockingMethod(methodDescriptor, null, request); } catch (ServiceException e) { throw new org.apache.hbase.thirdparty.com.google.protobuf.ServiceException(e); } return null;// Convert 'response'. }
org.apache.hbase.thirdparty.com.google.protobuf.RpcCallback< org.apache.hbase.thirdparty.com.google.protobuf.Message> done) { if (method.getService() != getDescriptor()) { throw new java.lang.IllegalArgumentException( "Service.callMethod() given method descriptor for wrong " + "service type."); switch(method.getIndex()) { case 0: this.regionServerStartup(controller, (org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.RegionServerStartupRequest)request,
public final org.apache.hbase.thirdparty.com.google.protobuf.Message getRequestPrototype( org.apache.hbase.thirdparty.com.google.protobuf.Descriptors.MethodDescriptor method) { if (method.getService() != getDescriptor()) { throw new java.lang.IllegalArgumentException( "Service.getRequestPrototype() given method " + "descriptor for wrong service type."); } switch(method.getIndex()) { case 0: return org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockRequest.getDefaultInstance(); case 1: return org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockHeartbeatRequest.getDefaultInstance(); default: throw new java.lang.AssertionError("Can't get here."); } }
public final org.apache.hbase.thirdparty.com.google.protobuf.Message getResponsePrototype( org.apache.hbase.thirdparty.com.google.protobuf.Descriptors.MethodDescriptor method) { if (method.getService() != getDescriptor()) { throw new java.lang.IllegalArgumentException( "Service.getResponsePrototype() given method " + "descriptor for wrong service type."); switch(method.getIndex()) { case 0: return org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetRegionInfoResponse.getDefaultInstance();