Tabnine Logo
DriftClientFactoryManager.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
io.airlift.drift.client.DriftClientFactoryManager
constructor

Best Java code snippets using io.airlift.drift.client.DriftClientFactoryManager.<init> (Showing top 8 results out of 315)

origin: airlift/drift

@Provides
@Singleton
private static DriftClientFactoryManager<Annotation> getDriftClientFactory(
    ThriftCodecManager codecManager,
    MethodInvokerFactory<Annotation> methodInvokerFactory,
    MethodInvocationStatsFactory methodInvocationStatsFactory)
{
  return new DriftClientFactoryManager<>(codecManager, methodInvokerFactory, methodInvocationStatsFactory);
}
origin: io.airlift.drift/drift-client

@Provides
@Singleton
private static DriftClientFactoryManager<Annotation> getDriftClientFactory(
    ThriftCodecManager codecManager,
    MethodInvokerFactory<Annotation> methodInvokerFactory,
    MethodInvocationStatsFactory methodInvocationStatsFactory)
{
  return new DriftClientFactoryManager<>(codecManager, methodInvokerFactory, methodInvocationStatsFactory);
}
origin: airlift/drift

@Test
public void testInvoker()
    throws Exception
{
  ResultsSupplier resultsSupplier = new ResultsSupplier();
  MockMethodInvokerFactory<String> methodInvokerFactory = new MockMethodInvokerFactory<>(resultsSupplier);
  TestingMethodInvocationStatsFactory statsFactory = new TestingMethodInvocationStatsFactory();
  List<TestingExceptionClassifier> classifiers = ImmutableList.of(new TestingExceptionClassifier(), new TestingExceptionClassifier(), new TestingExceptionClassifier());
  DriftClientFactoryManager<String> clientFactoryManager = new DriftClientFactoryManager<>(codecManager, methodInvokerFactory, statsFactory);
  DriftClientFactory driftClientFactory = clientFactoryManager.createDriftClientFactory("clientIdentity", new MockAddressSelector(), mergeExceptionClassifiers(classifiers));
  DriftClient<Client> driftClient = driftClientFactory.createDriftClient(Client.class, Optional.empty(), ImmutableList.of(), new DriftClientConfig());
  Client client = driftClient.get(ADDRESS_SELECTION_CONTEXT, HEADERS);
  assertEquals(methodInvokerFactory.getClientIdentity(), "clientIdentity");
  testClient(resultsSupplier, ImmutableList.of(methodInvokerFactory.getMethodInvoker()), classifiers, statsFactory, client, Optional.empty());
}
origin: airlift/drift

@Test
public void testFilter()
    throws Exception
{
  ResultsSupplier resultsSupplier = new ResultsSupplier();
  PassThroughFilter passThroughFilter = new PassThroughFilter();
  ShortCircuitFilter shortCircuitFilter = new ShortCircuitFilter(resultsSupplier);
  MockMethodInvokerFactory<String> invokerFactory = new MockMethodInvokerFactory<>(resultsSupplier);
  TestingMethodInvocationStatsFactory statsFactory = new TestingMethodInvocationStatsFactory();
  List<TestingExceptionClassifier> classifiers = ImmutableList.of(new TestingExceptionClassifier(), new TestingExceptionClassifier(), new TestingExceptionClassifier());
  DriftClientFactoryManager<String> clientFactoryManager = new DriftClientFactoryManager<>(codecManager, invokerFactory, statsFactory);
  DriftClientFactory driftClientFactory = clientFactoryManager.createDriftClientFactory("clientIdentity", new MockAddressSelector(), mergeExceptionClassifiers(classifiers));
  DriftClient<Client> driftClient = driftClientFactory.createDriftClient(
      Client.class,
      Optional.empty(),
      ImmutableList.of(passThroughFilter, shortCircuitFilter),
      new DriftClientConfig());
  Client client = driftClient.get(ADDRESS_SELECTION_CONTEXT, HEADERS);
  assertEquals(invokerFactory.getClientIdentity(), "clientIdentity");
  testClient(resultsSupplier, ImmutableList.of(passThroughFilter, shortCircuitFilter), classifiers, statsFactory, client, Optional.empty());
}
origin: airlift/drift

private static int logApacheThriftDriftClientAsync(
    HostAndPort address,
    String headerValue,
    List<DriftLogEntry> entries,
    List<MethodInvocationFilter> filters,
    Transport transport,
    Protocol protocol,
    boolean secure)
{
  if (!isValidConfiguration(transport, protocol)) {
    return 0;
  }
  AddressSelector<?> addressSelector = context -> Optional.of(() -> address);
  ApacheThriftClientConfig config = new ApacheThriftClientConfig()
      .setTransport(toApacheThriftTransport(transport))
      .setProtocol(toApacheThriftProtocol(protocol))
      .setTrustCertificate(ClientTestUtils.getCertificateChainFile())
      .setSslEnabled(secure);
  ApacheThriftConnectionFactoryConfig factoryConfig = new ApacheThriftConnectionFactoryConfig();
  try (ApacheThriftMethodInvokerFactory<String> methodInvokerFactory = new ApacheThriftMethodInvokerFactory<>(factoryConfig, clientIdentity -> config)) {
    DriftClientFactoryManager<String> proxyFactoryManager = new DriftClientFactoryManager<>(CODEC_MANAGER, methodInvokerFactory);
    DriftClientFactory proxyFactory = proxyFactoryManager.createDriftClientFactory("myFactory", addressSelector, NORMAL_RESULT);
    DriftAsyncScribe scribe = proxyFactory.createDriftClient(DriftAsyncScribe.class, Optional.empty(), filters, new DriftClientConfig()).get();
    assertEquals(scribe.log(headerValue, entries).get(), DRIFT_OK);
  }
  catch (Exception e) {
    throw new RuntimeException(e);
  }
  return 1;
}
origin: airlift/drift

      clientIdentity -> config,
      testingAllocator)) {
DriftClientFactoryManager<String> proxyFactoryManager = new DriftClientFactoryManager<>(CODEC_MANAGER, methodInvokerFactory);
DriftClientFactory proxyFactory = proxyFactoryManager.createDriftClientFactory("myFactory", addressSelector, NORMAL_RESULT);
origin: airlift/drift

      clientIdentity -> config,
      testingAllocator)) {
DriftClientFactoryManager<String> clientFactoryManager = new DriftClientFactoryManager<>(CODEC_MANAGER, methodInvokerFactory);
DriftClientFactory proxyFactory = clientFactoryManager.createDriftClientFactory("clientIdentity", addressSelector, NORMAL_RESULT);
origin: airlift/drift

private static int logApacheThriftDriftClient(
    HostAndPort address,
    String headerValue,
    List<DriftLogEntry> entries,
    List<MethodInvocationFilter> filters,
    Transport transport,
    Protocol protocol,
    boolean secure)
{
  if (!isValidConfiguration(transport, protocol)) {
    return 0;
  }
  AddressSelector<?> addressSelector = context -> Optional.of(() -> address);
  ApacheThriftClientConfig config = new ApacheThriftClientConfig()
      .setTransport(toApacheThriftTransport(transport))
      .setProtocol(toApacheThriftProtocol(protocol))
      .setTrustCertificate(ClientTestUtils.getCertificateChainFile())
      .setSslEnabled(secure);
  ApacheThriftConnectionFactoryConfig factoryConfig = new ApacheThriftConnectionFactoryConfig();
  try (ApacheThriftMethodInvokerFactory<String> methodInvokerFactory = new ApacheThriftMethodInvokerFactory<>(factoryConfig, clientIdentity -> config)) {
    DriftClientFactoryManager<String> clientFactoryManager = new DriftClientFactoryManager<>(CODEC_MANAGER, methodInvokerFactory);
    DriftClientFactory proxyFactory = clientFactoryManager.createDriftClientFactory("clientIdentity", addressSelector, NORMAL_RESULT);
    DriftScribe scribe = proxyFactory.createDriftClient(DriftScribe.class, Optional.empty(), filters, new DriftClientConfig()).get();
    assertEquals(scribe.log(headerValue, entries), DRIFT_OK);
  }
  catch (Exception e) {
    throw new RuntimeException(e);
  }
  return 1;
}
io.airlift.drift.clientDriftClientFactoryManager<init>

Popular methods of DriftClientFactoryManager

  • createDriftClientFactory

Popular in Java

  • Making http post requests using okhttp
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • requestLocationUpdates (LocationManager)
  • setRequestProperty (URLConnection)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Table (org.hibernate.mapping)
    A relational table
  • 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