Hi,
I'm trying to use a key object that has an enum type in a partitionned region. We use DataSerializable, in 6.6.3.5.
I try to bulk load 20'000 items, but only the first few dozen items get loaded, and then the gemfire cache servers appear to get stuck.
A thread dump of the cache server instance shows the following stack trace:
"ServerConnection on port 61319 Thread 2" prio=6 tid=0x07487800 nid=0x2e70 waiting on condition [0x0b55f000]
java.lang.Thread.State: TIMED_WAITING (sleeping)
at java.lang.Thread.sleep(Native Method)
at com.gemstone.gemfire.internal.cache.PartitionedRegion$RetryTimeKeeper.waitForBucketsRecovery(PartitionedRegion.java:7403)
at com.gemstone.gemfire.internal.cache.PartitionedRegion$RetryTimeKeeper.waitToRetryNode(PartitionedRegion.java:7386)
at com.gemstone.gemfire.internal.cache.PartitionedRegion.sendMsgByBucket(PartitionedRegion.java:2076)
at com.gemstone.gemfire.internal.cache.PartitionedRegion.postPutAllSend(PartitionedRegion.java:1951)
at com.gemstone.gemfire.internal.cache.LocalRegionDataView.postPutAll(LocalRegionDataView.java:213)
at com.gemstone.gemfire.internal.cache.LocalRegion.basicPutAll(LocalRegion.java:8408)
at com.gemstone.gemfire.internal.cache.LocalRegion.basicBridgePutAll(LocalRegion.java:8287)
at com.gemstone.gemfire.internal.cache.tier.sockets.command.PutAll.cmdExecute(PutAll.java:205)
at com.gemstone.gemfire.internal.cache.tier.sockets.BaseCommand.execute(BaseCommand.java:167)
at com.gemstone.gemfire.internal.cache.tier.sockets.ServerConnection.doNormalMsg(ServerConnection.java:774)
at com.gemstone.gemfire.internal.cache.tier.sockets.ServerConnection.doOneMessage(ServerConnection.java:905)
at com.gemstone.gemfire.internal.cache.tier.sockets.ServerConnection.run(ServerConnection.java:1151)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at com.gemstone.gemfire.internal.cache.tier.sockets.AcceptorImpl$1$1.run(AcceptorImpl.java:511)
at java.lang.Thread.run(Thread.java:662)
The same stack trace can be seen in the other instances.
The key is composed of the following fields:
private String entityCode;
private String sid;
private UserRoleAccOrRelTypeEnum type;
private int accOrRelId;
with the enum defined like so:
public enum UserRoleAccOrRelTypeEnum {
ACCOUNT, RELATION;
}
The fromData/toData() methods:
@Override
public void fromData(DataInput in) throws IOException,
ClassNotFoundException {
entityCode = in.readUTF();
sid = in.readUTF();
type = UserRoleAccOrRelTypeEnum.valueOf(in.readUTF());
accOrRelId = in.readInt();
}
@Override
public void toData(DataOutput out) throws IOException {
out.writeUTF(entityCode);
out.writeUTF(sid);
out.writeUTF(type.name());
out.writeInt(accOrRelId);
}
Reverting the "type" field to be a String solves the problem, and REPLICATE regions with enum in the key work fine.
Any suggestions appreciated!
Thanks!
Michael