Server { public void addSuppressedLoggingExceptions(Class<?>... exceptionClass) { exceptionsHandler.addSuppressedLoggingExceptions(exceptionClass); } protected  Server(String bindAddress, int port,
                  Class<? extends Writable> paramClass, int handlerCount, 
                  Configuration conf); protected  Server(String bindAddress, int port,
      Class<? extends Writable> rpcRequestClass, int handlerCount,
      int numReaders, int queueSizePerHandler, Configuration conf,
      String serverName, SecretManager<? extends TokenIdentifier> secretManager); @SuppressWarnings("unchecked") protected  Server(String bindAddress, int port,
      Class<? extends Writable> rpcRequestClass, int handlerCount,
      int numReaders, int queueSizePerHandler, Configuration conf,
      String serverName, SecretManager<? extends TokenIdentifier> secretManager,
      String portRangeConfig); void addTerseExceptions(Class<?>... exceptionClass); void addSuppressedLoggingExceptions(Class<?>... exceptionClass); void setAlignmentContext(AlignmentContext alignmentContext); static void registerProtocolEngine(RPC.RpcKind rpcKind, 
          Class<? extends Writable> rpcRequestWrapperClass,
          RpcInvoker rpcInvoker); Class<? extends Writable> getRpcRequestWrapper(
      RpcKindProto rpcKind); static RpcInvoker getRpcInvoker(RPC.RpcKind rpcKind); static Server get(); @VisibleForTesting static ThreadLocal<Call> getCurCall(); static int getCallId(); static int getCallRetryCount(); static InetAddress getRemoteIp(); static String getAuxiliaryPortEstablishedQOP(); static byte[] getClientId(); static String getRemoteAddress(); static UserGroupInformation getRemoteUser(); static String getProtocol(); static boolean isRpcInvocation(); static int getPriorityLevel(); static void bind(ServerSocket socket, InetSocketAddress address, 
                          int backlog); static void bind(ServerSocket socket, InetSocketAddress address, 
      int backlog, Configuration conf, String rangeConf); @VisibleForTesting RpcMetrics getRpcMetrics(); @VisibleForTesting RpcDetailedMetrics getRpcDetailedMetrics(); void refreshServiceAcl(Configuration conf, PolicyProvider provider); @Private void refreshServiceAclWithLoadedConfiguration(Configuration conf,
      PolicyProvider provider); @InterfaceAudience.LimitedPrivate({"HDFS", "MapReduce"}) ServiceAuthorizationManager getServiceAuthorizationManager(); synchronized void refreshCallQueue(Configuration conf); void queueCall(Call call); synchronized void addAuxiliaryListener(int auxiliaryPort); void setSocketSendBufSize(int size); void setTracer(Tracer t); synchronized void start(); synchronized void stop(); synchronized void join(); synchronized InetSocketAddress getListenerAddress(); synchronized Set<InetSocketAddress> getAuxiliaryListenerAddresses(); @Deprecated Writable call(Writable param, long receiveTime); abstract Writable call(RPC.RpcKind rpcKind, String protocol,
      Writable param, long receiveTime); int getPort(); int getNumOpenConnections(); String getNumOpenConnectionsPerUser(); long getNumDroppedConnections(); int getCallQueueLen(); boolean isClientBackoffEnabled(); void setClientBackoffEnabled(boolean value); int getMaxQueueSize(); int getNumReaders(); String getServerName(); static final Logger LOG; static final Logger AUDITLOG; }
@Test public void testExceptionsHandlerSuppressed() { Server.ExceptionsHandler handler = new Server.ExceptionsHandler(); handler.addSuppressedLoggingExceptions(IOException.class); handler.addSuppressedLoggingExceptions(RpcServerException.class, IpcException.class); assertTrue(handler.isSuppressedLog(IOException.class)); assertTrue(handler.isSuppressedLog(RpcServerException.class)); assertTrue(handler.isSuppressedLog(IpcException.class)); assertFalse(handler.isSuppressedLog(RpcClientException.class)); }