Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hrcpp 390/rm some expected fail #302

Merged
merged 3 commits into from
Sep 26, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ public RemoteCacheManager(Configuration config) {

public RemoteCacheManager(Configuration config, boolean start) {
jniRemoteCacheManager = new org.infinispan.client.hotrod.jni.RemoteCacheManager(config.getJniConfiguration(), start);
marshaller = new org.infinispan.commons.marshall.jboss.GenericJBossMarshaller();
marshaller = (config.marshaller()!=null) ? config.marshaller() :
new org.infinispan.commons.marshall.jboss.GenericJBossMarshaller();
}

public RemoteCacheManager(URL config, boolean start) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,20 @@ public Configuration(org.infinispan.client.hotrod.jni.Configuration jniConfigura
this.transportFactory = null;
}

public Configuration(org.infinispan.client.hotrod.jni.Configuration jniConfiguration, Marshaller marshaller2) {
super();
this.jniConfiguration = jniConfiguration;
this.asyncExecutorFactory = null;
this.balancingStrategy = null;
this.classLoader = null;
this.consistentHashImpl = null;
this.marshallerClass = (marshaller2==null) ? null : marshaller2.getClass();
this.marshaller = marshaller2;
this.servers = null;
this.failoverServers = null;
this.transportFactory = null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation looks wrong on this line

}

Configuration(ExecutorFactoryConfiguration asyncExecutorFactory, Class<? extends RequestBalancingStrategy> balancingStrategy, ClassLoader classLoader,
ConnectionPoolConfiguration connectionPool, int connectionTimeout, Class<? extends ConsistentHash>[] consistentHashImpl, boolean forceReturnValues, int keySizeEstimate, Class<? extends Marshaller> marshallerClass,
boolean pingOnStartup, String protocolVersion, List<ServerConfiguration> servers, List<ServerConfiguration> failOverServers, int socketTimeout, SslConfiguration ssl, boolean tcpNoDelay,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,8 @@ public ConfigurationBuilder marshaller(Class<? extends Marshaller> marshaller) {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this^^^ version of the method work too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok enabled

@Override
public ConfigurationBuilder marshaller(Marshaller marshaller) {
throw new UnsupportedOperationException();
// this.marshaller = marshaller;
// return this;
this.marshaller = marshaller;
return this;
}

@Override
Expand Down Expand Up @@ -290,8 +289,9 @@ public Configuration create() {

@Override
public Configuration build() {
return new Configuration(this.jniConfigurationBuilder.build());
}
return (marshaller != null) ? new Configuration(this.jniConfigurationBuilder.build(), marshaller)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation looks wrong on these lines

: new Configuration(this.jniConfigurationBuilder.build(), marshaller);
}

public Configuration build(boolean validate) {
if (validate) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,10 @@ public static void main(String[] args) {
"BulkGetKeysDistTest.testBulkGetAfterLifespanExpire", // unstable, ISPN-4017
"HotRodIntegrationTest.testReplaceWithVersionWithLifespanAsync", // async not implemented
"ClientSocketReadTimeoutTest.testPutTimeout", // TODO: TransportException not marshalled correctly
"RemoteCacheManagerTest.testMarshallerInstance", // setting marshaller through configuration builder not implemented
"BulkGetKeysReplTest.testBulkGetAfterLifespanExpire",
"BulkGetKeysSimpleTest.testBulkGetAfterLifespanExpire",
"BulkGetReplTest.testBulkGetAfterLifespanExpire",
"BulkGetSimpleTest.testBulkGetAfterLifespanExpire",
"ForceReturnValuesTest.testDifferentInstancesForDifferentForceReturnValues",
"ForceReturnValuesTest.testSameInstanceForSameForceReturnValues",
"HotRodIntegrationTest.testGetWithMetadata",
"RemoteCacheManagerTest.testGetUndefinedCache"
Expand Down
5 changes: 3 additions & 2 deletions src/hotrod/impl/RemoteCacheManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ std::shared_ptr<RemoteCacheImpl> RemoteCacheManagerImpl::createRemoteCache(
const std::string& name, bool forceReturnValue, NearCacheConfiguration nc)
{
ScopedLock<Mutex> l(lock);
std::map<std::string, RemoteCacheHolder>::iterator iter = cacheName2RemoteCache.find(name);
std::string nameAndForceFlag = (forceReturnValue) ? name+"/true" : name+"/false";
std::map<std::string, RemoteCacheHolder>::iterator iter = cacheName2RemoteCache.find(nameAndForceFlag);
// Cache found
if (iter != cacheName2RemoteCache.end()) {
return iter->second.first;
Expand All @@ -123,7 +124,7 @@ std::shared_ptr<RemoteCacheImpl> RemoteCacheManagerImpl::createRemoteCache(
}
}
// If ping on startup is disabled, or cache is defined in server
cacheName2RemoteCache[name] = RemoteCacheHolder(rcache_sptr, forceReturnValue);
cacheName2RemoteCache[nameAndForceFlag] = RemoteCacheHolder(rcache_sptr, forceReturnValue);
return rcache_sptr;
}
catch (...)
Expand Down