當前位置: 首頁>>代碼示例>>Java>>正文


Java Marshaller類代碼示例

本文整理匯總了Java中org.infinispan.avro.client.Marshaller的典型用法代碼示例。如果您正苦於以下問題:Java Marshaller類的具體用法?Java Marshaller怎麽用?Java Marshaller使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Marshaller類屬於org.infinispan.avro.client包,在下文中一共展示了Marshaller類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: QueryOperation

import org.infinispan.avro.client.Marshaller; //導入依賴的package包/類
public QueryOperation(Codec codec, TransportFactory transportFactory, byte[] cacheName,
      AtomicInteger topologyId, Flag[] flags, RemoteQuery query) {
   super(codec, transportFactory, cacheName, topologyId, flags);
   this.remoteQuery = query;
   this.requestAvroMarshaller = new Marshaller<>(Request.class);
   this.responseAvroMarshaller = new Marshaller<>(Response.class);
}
 
開發者ID:leads-project,項目名稱:infinispan-avro,代碼行數:8,代碼來源:QueryOperation.java

示例2: createCacheManager

import org.infinispan.avro.client.Marshaller; //導入依賴的package包/類
@Override
protected EmbeddedCacheManager createCacheManager() throws Exception {
   if (cacheManager != null)
      return cacheManager;

   GlobalConfigurationBuilder gcb = new GlobalConfigurationBuilder().clusteredDefault();
   ConfigurationBuilder builder = hotRodCacheConfiguration(getDefaultClusteredCacheConfig(CacheMode.REPL_SYNC, false));
   builder.indexing().enable()
         .addProperty("default.directory_provider", "ram")
         .addProperty("lucene_version", "LUCENE_CURRENT");
   builder.jmxStatistics().enable();

   cacheManager = TestCacheManagerFactory.createClusteredCacheManager(gcb, new ConfigurationBuilder());
   cacheManager.defineConfiguration(TEST_CACHE_NAME, builder.build());
   cache = cacheManager.getCache(TEST_CACHE_NAME);

   hotRodServer = HotRodClientTestingUtil.startHotRodServer(cacheManager);

   org.infinispan.client.hotrod.configuration.ConfigurationBuilder clientBuilder =
         new org.infinispan.client.hotrod.configuration.ConfigurationBuilder();
   clientBuilder.addServer().host(hotRodServer.getAddress().host()).port(hotRodServer.getAddress().port());
   clientBuilder.marshaller(new Marshaller<>(Employee.class));
   remoteCacheManager = new RemoteCacheManager(clientBuilder.build());
   employeeCache = remoteCacheManager.getCache(TEST_CACHE_NAME);
   employeeQF = Search.getQueryFactory(employeeCache);

   Support.registerSchema(remoteCacheManager, Employee.getClassSchema());

   Thread.sleep(1000); // wait that the cluster forms

   return cacheManager;
}
 
開發者ID:leads-project,項目名稱:infinispan-avro,代碼行數:33,代碼來源:QueryTest.java

示例3: createClient

import org.infinispan.avro.client.Marshaller; //導入依賴的package包/類
@Override
protected RemoteCacheManager createClient(int i) {
   org.infinispan.client.hotrod.configuration.ConfigurationBuilder clientBuilder
         = new org.infinispan.client.hotrod.configuration.ConfigurationBuilder();
   clientBuilder.addServer().host(server(i).getAddress().host()).port(server(i).getAddress().port());
   clientBuilder.marshaller(new Marshaller<Employee>(Employee.class));
   return new RemoteCacheManager(clientBuilder.build());
}
 
開發者ID:leads-project,項目名稱:infinispan-avro,代碼行數:9,代碼來源:MultiHotRodQueryTest.java

示例4: createHotRodClientConfigurationBuilder

import org.infinispan.avro.client.Marshaller; //導入依賴的package包/類
@Override
protected org.infinispan.client.hotrod.configuration.ConfigurationBuilder createHotRodClientConfigurationBuilder(int serverPort) {
   org.infinispan.client.hotrod.configuration.ConfigurationBuilder clientBuilder = new org.infinispan.client.hotrod.configuration.ConfigurationBuilder();
   clientBuilder.addServer()
         .host("localhost")
         .port(serverPort)
         .pingOnStartup(false);
   clientBuilder.marshaller(new Marshaller<>(Employee.class));
   return clientBuilder;
}
 
開發者ID:leads-project,項目名稱:infinispan-avro,代碼行數:11,代碼來源:MultiHotRodQueryTest.java

示例5: initialize

import org.infinispan.avro.client.Marshaller; //導入依賴的package包/類
public synchronized void initialize(Class<K> keyClass, Class<T> persistentClass, Properties properties) throws Exception {

      if (cache!=null)
         return; // already initialized.

      this.keyClass = keyClass;
      this.persistentClass = persistentClass;

      String host = properties.getProperty(ISPN_CONNECTION_STRING_KEY,
            getConf().get(ISPN_CONNECTION_STRING_KEY, ISPN_CONNECTION_STRING_DEFAULT));
      conf.set(ISPN_CONNECTION_STRING_KEY, host);
      properties.setProperty(ISPN_CONNECTION_STRING_KEY, host);
      LOG.info("Connecting client to "+host);

      Marshaller<T> marshaller = new Marshaller<T>(persistentClass);
      ConfigurationBuilder builder = new ConfigurationBuilder();
      builder.addServers(host);
      builder.marshaller(marshaller);
      cacheManager = new RemoteCacheManager(builder.build());
      cacheManager.start();

      cache = cacheManager.getCache(persistentClass.getSimpleName());
      qf = org.infinispan.avro.hotrod.Search.getQueryFactory(cache);
      createSchema();

      toPut = new HashMap<>();
   }
 
開發者ID:leads-project,項目名稱:gora-infinispan,代碼行數:28,代碼來源:InfinispanClient.java

示例6: initialize

import org.infinispan.avro.client.Marshaller; //導入依賴的package包/類
public synchronized void initialize(Class<K> keyClass, Class<T> persistentClass, Properties properties) throws Exception {

    if (cache!=null)
      return; // already initialized.

    this.keyClass = keyClass;
    this.persistentClass = persistentClass;

    String host = properties.getProperty(ISPN_CONNECTION_STRING_KEY,
        getConf().get(ISPN_CONNECTION_STRING_KEY, ISPN_CONNECTION_STRING_DEFAULT));
    conf.set(ISPN_CONNECTION_STRING_KEY, host);
    properties.setProperty(ISPN_CONNECTION_STRING_KEY, host);
    LOG.info("Connecting client to "+host);

    Marshaller<T> marshaller = new Marshaller<>(persistentClass);
    ConfigurationBuilder builder = new ConfigurationBuilder();
    builder.addServers(host);
    builder.marshaller(marshaller);
    cacheManager = new RemoteCacheManager(builder.build());
    cacheManager.start();

    cache = cacheManager.getCache(persistentClass.getSimpleName());
    qf = org.infinispan.avro.hotrod.Search.getQueryFactory(cache);
    createSchema();

    toPut = new HashMap<>();
  }
 
開發者ID:apache,項目名稱:gora,代碼行數:28,代碼來源:InfinispanClient.java


注:本文中的org.infinispan.avro.client.Marshaller類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。