Tabnine Logo
ThriftServerConfig.setIdleConnectionTimeout
Code IndexAdd Tabnine to your IDE (free)

How to use
setIdleConnectionTimeout
method
in
com.facebook.swift.service.ThriftServerConfig

Best Java code snippets using com.facebook.swift.service.ThriftServerConfig.setIdleConnectionTimeout (Showing top 4 results out of 315)

origin: com.facebook.swift/swift-service

.setAcceptorThreadCount(3)
.setIoThreadCount(27)
.setIdleConnectionTimeout(Duration.valueOf("157ms"))
.setConnectionLimit(1111)
.setWorkerExecutorKey("my-executor")
origin: com.gitee.l0km/facelog-service

/**
 * 从配置文件中读取参数创建{@link ThriftServerConfig}实例
 * @return
 */
public static ThriftServerConfig makeThriftServerConfig(){
  ThriftServerConfig thriftServerConfig = new ThriftServerConfig();
  CombinedConfiguration config = GlobalConfig.getConfig();
  int intValue ;
  thriftServerConfig.setPort(config.getInt(SERVER_PORT,DEFAULT_PORT));
  if((intValue  = config.getInt(SERVER_CONNECTION_LIMIT,0)) >0){
    thriftServerConfig.setConnectionLimit(intValue);
  }
  if((intValue = config.getInt(SERVER_IDLE_CONNECTION_TIMEMOUT,0))>0){
    Duration timeout = new Duration(intValue,TimeUnit.SECONDS);
    thriftServerConfig.setIdleConnectionTimeout(timeout);
  }
  if((intValue = config.getInt(SERVER_WORKER_THREAD_COUNT,0))>0){
    thriftServerConfig.setWorkerThreads(intValue);
  }
  return thriftServerConfig;
}
/**
origin: com.gitee.l0km/faceapi-thriftservice

public static void main(String ...args){
  serviceConfig.parseCommandLine(args);
  // 设置slf4j记录日志,否则会有警告
  InternalLoggerFactory.setDefaultFactory(new Slf4JLoggerFactory());
  ThriftServerConfig config = new ThriftServerConfig()
      .setPort(serviceConfig.getServicePort())
      .setWorkerThreads(serviceConfig.getWorkThreads())
      .setConnectionLimit(serviceConfig.getConnectionLimit())
      .setIdleConnectionTimeout(new Duration(serviceConfig.getIdleConnectionTimeout(),TimeUnit.SECONDS));
  FaceApi faceapi = serviceConfig.getFaceapi();
  ThriftServerService service = ThriftServerService.bulider()
      .withServices(new FaceApiThriftDecorator(faceapi))
      .setThriftServerConfig(config)
      .build();
  logger.info("FaceApi instance:{}",faceapi);
  service.startAsync();
}
 
origin: com.facebook.swift/swift-service

@Test
public void testDefaults()
{
  ConfigAssertions.assertRecordedDefaults(
      ConfigAssertions.recordDefaults(ThriftServerConfig.class)
          .setBindAddress("localhost")
          .setAcceptBacklog(1024)
          .setMaxFrameSize(DataSize.valueOf("64MB"))
          .setPort(0)
          .setConnectionLimit(0)
          .setWorkerThreads(200)
          .setAcceptorThreadCount(1)
          .setIoThreadCount(2 * Runtime.getRuntime().availableProcessors())
          .setIdleConnectionTimeout(Duration.valueOf("60s"))
          .setTransportName("framed")
          .setProtocolName("binary")
          .setWorkerExecutorKey(null)
          .setTaskExpirationTimeout(Duration.valueOf("5s"))
          .setQueueTimeout(null)
          .setMaxQueuedRequests(null)
          .setMaxQueuedResponsesPerConnection(16)
          .setTrafficClass(0)
  );
}
com.facebook.swift.serviceThriftServerConfigsetIdleConnectionTimeout

Popular methods of ThriftServerConfig

  • <init>
  • setPort
  • setConnectionLimit
  • setWorkerThreads
  • getBindAddress
  • getConnectionLimit
  • getIdleConnectionTimeout
  • getPort
  • getWorkerThreads
  • setAcceptBacklog
  • setAcceptorThreadCount
  • setBindAddress
  • setAcceptorThreadCount,
  • setBindAddress,
  • setIoThreadCount,
  • setMaxFrameSize,
  • setMaxQueuedRequests,
  • setMaxQueuedResponsesPerConnection,
  • setProtocolName,
  • setQueueTimeout,
  • setTaskExpirationTimeout

Popular in Java

  • Finding current android device location
  • getExternalFilesDir (Context)
  • compareTo (BigDecimal)
  • addToBackStack (FragmentTransaction)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • String (java.lang)
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now