use of org.infinispan.client.hotrod.RemoteCacheManager in project camel by apache.
the class InfinispanRemoteQueryProducerIT method doPreSetup.
@Override
protected void doPreSetup() throws IOException {
ConfigurationBuilder builder = new ConfigurationBuilder().addServer().host("localhost").port(11222).marshaller(new ProtoStreamMarshaller());
manager = new RemoteCacheManager(builder.build());
RemoteCache<String, String> metadataCache = manager.getCache(ProtobufMetadataManagerConstants.PROTOBUF_METADATA_CACHE_NAME);
metadataCache.put("sample_bank_account/bank.proto", Util.read(InfinispanRemoteQueryProducerIT.class.getResourceAsStream("/sample_bank_account/bank.proto")));
MarshallerRegistration.registerMarshallers(ProtoStreamMarshaller.getSerializationContext(manager));
SerializationContext serCtx = ProtoStreamMarshaller.getSerializationContext(manager);
serCtx.registerProtoFiles(FileDescriptorSource.fromResources("/sample_bank_account/bank.proto"));
serCtx.registerMarshaller(new UserMarshaller());
serCtx.registerMarshaller(new GenderMarshaller());
}
use of org.infinispan.client.hotrod.RemoteCacheManager in project hazelcast-simulator by hazelcast.
the class InfinispanDriver method startVendorInstance.
@Override
public void startVendorInstance() throws Exception {
String workerType = get("WORKER_TYPE");
if ("javaclient".equals(workerType)) {
Properties hotrodProperties = new Properties();
hotrodProperties.setProperty("infinispan.client.hotrod.server_list", get("server_list"));
Configuration configuration = new ConfigurationBuilder().withProperties(hotrodProperties).build();
RemoteCacheManager remoteCacheManager = new RemoteCacheManager(configuration);
this.cacheContainer = remoteCacheManager;
remoteCacheManager.start();
} else {
DefaultCacheManager defaultCacheManager = new DefaultCacheManager("infinispan.xml");
this.cacheContainer = defaultCacheManager;
defaultCacheManager.start();
HotRodServerConfiguration hotRodServerConfiguration = new HotRodServerConfigurationBuilder().host(get("PRIVATE_ADDRESS")).port(11222).build();
this.hotRodServer = new HotRodServer();
hotRodServer.start(hotRodServerConfiguration, defaultCacheManager);
}
}
use of org.infinispan.client.hotrod.RemoteCacheManager in project YCSB by brianfrankcooper.
the class RemoteCacheManagerHolder method getInstance.
static RemoteCacheManager getInstance(Properties props) {
RemoteCacheManager result = cacheManager;
if (result == null) {
synchronized (RemoteCacheManagerHolder.class) {
result = cacheManager;
if (result == null) {
result = new RemoteCacheManager(props);
cacheManager = new RemoteCacheManager(props);
}
}
}
return result;
}
use of org.infinispan.client.hotrod.RemoteCacheManager in project jnosql-diana-driver by eclipse.
the class InfinispanKeyValueConfiguration method get.
/**
* Creates a {@link InfinispanBucketManagerFactory} from configuration map
* @param configurations the configuration map
* @return the InfinispanBucketManagerFactory instance
* @throws NullPointerException when configurations is null
*/
public InfinispanBucketManagerFactory get(Map<String, String> configurations) {
requireNonNull(configurations, "configurations is required");
List<String> servers = configurations.keySet().stream().filter(s -> s.startsWith("infinispan-server-")).collect(Collectors.toList());
if (!servers.isEmpty()) {
org.infinispan.client.hotrod.configuration.ConfigurationBuilder builder = new org.infinispan.client.hotrod.configuration.ConfigurationBuilder();
for (String server : servers) {
builder.addServer().host(server);
}
return new InfinispanBucketManagerFactory(new RemoteCacheManager(builder.build()));
} else if (configurations.containsKey("infinispan-config")) {
try {
return new InfinispanBucketManagerFactory(new DefaultCacheManager(configurations.get("infinispan-config")));
} catch (IOException e) {
throw new RuntimeException(e);
}
} else {
GlobalConfigurationBuilder builder = new GlobalConfigurationBuilder();
builder.globalJmxStatistics().allowDuplicateDomains(true);
return new InfinispanBucketManagerFactory(new DefaultCacheManager(builder.build()));
}
}
Aggregations