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

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

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

origin: com.facebook.swift/swift-service

.setIoThreadCount(27)
.setIdleConnectionTimeout(Duration.valueOf("157ms"))
.setConnectionLimit(1111)
.setWorkerExecutorKey("my-executor")
.setTransportName("buffered")
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.serviceThriftServerConfigsetConnectionLimit

Popular methods of ThriftServerConfig

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

Popular in Java

  • Updating database using SQL prepared statement
  • setContentView (Activity)
  • runOnUiThread (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Best IntelliJ plugins
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