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

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

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

origin: com.facebook.swift/swift-service

protected ThriftServer createTargetServer(int numThreads)
    throws TException, InstantiationException, IllegalAccessException
{
  DelayedMapSyncHandler handler = new DelayedMapSyncHandler();
  return createServerFromHandler(new ThriftServerConfig().setWorkerThreads(numThreads), handler);
}
origin: com.facebook.swift/swift-service

protected ThriftServer createAsyncServer(int numThreads, ThriftClientManager clientManager, ThriftServer targetServer) throws Exception
{
  DelayedMapAsyncProxyHandler handler = new DelayedMapAsyncProxyHandler(clientManager, targetServer);
  return createServerFromHandler(new ThriftServerConfig().setWorkerThreads(numThreads), handler);
}
origin: com.facebook.swift/swift-service

.setBindAddress("127.0.0.1")
.setAcceptBacklog(7777)
.setWorkerThreads(111)
.setAcceptorThreadCount(3)
.setIoThreadCount(27)
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.serviceThriftServerConfigsetWorkerThreads

Popular methods of ThriftServerConfig

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

Popular in Java

  • Reactive rest calls using spring rest template
  • getSharedPreferences (Context)
  • putExtra (Intent)
  • findViewById (Activity)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Top 12 Jupyter Notebook extensions
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