当前位置: 首页>>代码示例>>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;未经允许,请勿转载。