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

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

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

origin: com.gitee.l0km/common-thrift

/**
 * 设置服务端口
 * @param servicePort
 * @return
 * @see ThriftServerConfig#setPort(int)
 */
public Builder setServerPort(int servicePort) {
  this.thriftServerConfig.setPort(servicePort);
  return this;
}
origin: io.zipkin.zipkin2/zipkin-collector-scribe

ScribeCollector(Builder builder) {
 ScribeSpanConsumer scribe = new ScribeSpanConsumer(builder);
 ThriftServiceProcessor processor =
   new ThriftServiceProcessor(new ThriftCodecManager(), emptyList(), scribe);
 server = new ThriftServer(processor, new ThriftServerConfig().setPort(builder.port));
}
origin: io.zipkin.java/zipkin-transport-scribe

ScribeCollector(Builder builder, Lazy<AsyncSpanConsumer> consumer) {
 ScribeSpanConsumer scribe = new ScribeSpanConsumer(builder.category, consumer, builder.metrics);
 ThriftServiceProcessor processor =
   new ThriftServiceProcessor(new ThriftCodecManager(), emptyList(), scribe);
 server = new ThriftServer(processor, new ThriftServerConfig().setPort(builder.port)).start();
}
origin: melin/dubbo-rpc-swift

@Override
protected <T> Runnable doExport(T impl, Class<T> type, URL url)
    throws RpcException {
  TProcessor processor = new ThriftServiceProcessor(new ThriftCodecManager(), impl);
  final ThriftServer server = new ThriftServer(processor, new ThriftServerConfig().setPort(url.getPort()));
  server.start();
  return new Runnable() {
    public void run() {
      try {
        server.close();
      } catch (Throwable e) {
        logger.warn(e.getMessage(), e);
      }
    }
  };
}
origin: com.facebook.swift/swift-service

.setPort(12345)
.setMaxFrameSize(DataSize.valueOf("333kB"))
.setBindAddress("127.0.0.1")
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.serviceThriftServerConfigsetPort

Popular methods of ThriftServerConfig

  • <init>
  • setConnectionLimit
  • setIdleConnectionTimeout
  • 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
  • startActivity (Activity)
  • addToBackStack (FragmentTransaction)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Top PhpStorm 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