本文整理了Java中org.infinispan.configuration.cache.Configuration.encoding()
方法的一些代码示例,展示了Configuration.encoding()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.encoding()
方法的具体详情如下:
包路径:org.infinispan.configuration.cache.Configuration
类名称:Configuration
方法名:encoding
暂无
代码示例来源:origin: org.infinispan/infinispan-server-hotrod
private static KeyValuePair<String, String> getRequestMediaTypes(HotRodHeader header, Configuration configuration) {
String keyRequestType = header == null ? APPLICATION_UNKNOWN_TYPE : header.getKeyMediaType().toString();
String valueRequestType = header == null ? APPLICATION_UNKNOWN_TYPE : header.getValueMediaType().toString();
if (header != null && HotRodVersion.HOTROD_28.isOlder(header.version)) {
// Pre-2.8 clients always send protobuf payload to the metadata cache
if (header.cacheName.equals(PROTOBUF_METADATA_CACHE_NAME)) {
keyRequestType = APPLICATION_PROTOSTREAM_TYPE;
valueRequestType = APPLICATION_PROTOSTREAM_TYPE;
} else {
// Pre-2.8 clients always sent query encoded as protobuf unless object store is used.
if (header.op == HotRodOperation.QUERY) {
boolean objectStorage = APPLICATION_OBJECT.match(configuration.encoding().valueDataType().mediaType());
keyRequestType = objectStorage ? APPLICATION_JBOSS_MARSHALLING_TYPE : APPLICATION_PROTOSTREAM_TYPE;
valueRequestType = objectStorage ? APPLICATION_JBOSS_MARSHALLING_TYPE : APPLICATION_PROTOSTREAM_TYPE;
}
}
}
return new KeyValuePair<>(keyRequestType, valueRequestType);
}
代码示例来源:origin: org.infinispan/infinispan-server-hotrod
newTopology = getTopologyResponse(header.clientIntel, header.topologyId, addressCache, cacheMode, cacheTopology);
if (configuration != null) {
keyMediaType = configuration.encoding().keyDataType().mediaType();
valueMediaType = configuration.encoding().valueDataType().mediaType();
objectStorage = APPLICATION_OBJECT.match(keyMediaType);
代码示例来源:origin: org.infinispan/infinispan-core
@Override
public void check(ConfigurationBuilderHolder holder) {
GlobalStateConfiguration gs = getGlobalConfiguration(holder).globalState();
assertEquals(ConfigurationStorage.OVERLAY, gs.configurationStorage());
assertEquals("sharedPath", gs.sharedPersistentLocation());
EncodingConfiguration encoding = getConfiguration(holder, "local").encoding();
assertEquals(MediaType.APPLICATION_OBJECT, encoding.keyDataType().mediaType());
assertEquals(MediaType.APPLICATION_OBJECT, encoding.valueDataType().mediaType());
MemoryConfiguration memory = getConfiguration(holder, "dist-template").memory();
assertEquals(EvictionStrategy.REMOVE, memory.evictionStrategy());
}
},
代码示例来源:origin: org.infinispan/infinispan-core
@Override
public void check(ConfigurationBuilderHolder holder) {
GlobalStateConfiguration gs = getGlobalConfiguration(holder).globalState();
assertEquals(ConfigurationStorage.OVERLAY, gs.configurationStorage());
assertEquals("sharedPath", gs.sharedPersistentLocation());
EncodingConfiguration encoding = getConfiguration(holder, "local").encoding();
assertEquals(MediaType.APPLICATION_OBJECT, encoding.keyDataType().mediaType());
assertEquals(MediaType.APPLICATION_OBJECT, encoding.valueDataType().mediaType());
PartitionHandlingConfiguration ph = getConfiguration(holder, "dist").clustering().partitionHandling();
assertTrue(ph.enabled());
assertEquals(PartitionHandling.ALLOW_READS, ph.whenSplit());
assertEquals(MergePolicy.PREFERRED_NON_NULL, ph.mergePolicy());
ph = getConfiguration(holder, "repl").clustering().partitionHandling();
assertFalse(ph.enabled());
assertEquals(PartitionHandling.ALLOW_READ_WRITES, ph.whenSplit());
assertEquals(MergePolicy.NONE, ph.mergePolicy());
MemoryConfiguration mc = getConfiguration(holder, "off-heap-memory").memory();
assertEquals(StorageType.OFF_HEAP, mc.storageType());
assertEquals(10000000, mc.size());
assertEquals(4, mc.addressCount());
assertEquals(EvictionType.MEMORY, mc.evictionType());
mc = getConfiguration(holder, "binary-memory").memory();
assertEquals(StorageType.BINARY, mc.storageType());
assertEquals(1, mc.size());
mc = getConfiguration(holder, "object-memory").memory();
assertEquals(StorageType.OBJECT, mc.storageType());
}
},
内容来源于网络,如有侵权,请联系作者删除!