use of org.apache.geode.cache.client.internal.ExecutablePool in project geode by apache.
the class ClientTypeRegistration method getType.
public PdxType getType(int typeId) {
Collection<Pool> pools = getAllPools();
ServerConnectivityException lastException = null;
for (Pool pool : pools) {
try {
PdxType type = GetPDXTypeByIdOp.execute((ExecutablePool) pool, typeId);
if (type != null) {
return type;
}
} catch (ServerConnectivityException e) {
logger.debug("Received an exception getting pdx type from pool {}, {}", pool, e.getMessage(), e);
// ignore, try the next pool.
lastException = e;
}
}
if (lastException != null) {
throw lastException;
} else {
throw returnCorrectExceptionForFailure(pools, typeId, lastException);
}
}
use of org.apache.geode.cache.client.internal.ExecutablePool in project geode by apache.
the class ClientTypeRegistration method defineType.
public int defineType(PdxType newType) {
Collection<Pool> pools = getAllPools();
ServerConnectivityException lastException = null;
int newTypeId = -1;
for (Pool pool : pools) {
try {
newTypeId = GetPDXIdForTypeOp.execute((ExecutablePool) pool, newType);
newType.setTypeId(newTypeId);
sendTypeToPool(newType, newTypeId, pool);
return newTypeId;
} catch (ServerConnectivityException e) {
// ignore, try the next pool.
lastException = e;
}
}
throw returnCorrectExceptionForFailure(pools, newTypeId, lastException);
}
use of org.apache.geode.cache.client.internal.ExecutablePool in project geode by apache.
the class ClientTypeRegistration method enums.
@SuppressWarnings({ "unchecked", "serial" })
@Override
public Map<Integer, EnumInfo> enums() {
Collection<Pool> pools = getAllPools();
Map<Integer, EnumInfo> enums = new HashMap<>();
for (Pool p : pools) {
enums.putAll(GetPDXEnumsOp.execute((ExecutablePool) p));
}
return enums;
}
use of org.apache.geode.cache.client.internal.ExecutablePool in project geode by apache.
the class ClientTypeRegistration method types.
@SuppressWarnings({ "unchecked", "serial" })
@Override
public Map<Integer, PdxType> types() {
Collection<Pool> pools = getAllPools();
Map<Integer, PdxType> types = new HashMap<>();
for (Pool p : pools) {
try {
types.putAll(GetPDXTypesOp.execute((ExecutablePool) p));
} catch (Exception e) {
e.printStackTrace();
}
}
return types;
}
use of org.apache.geode.cache.client.internal.ExecutablePool in project geode by apache.
the class ClientTypeRegistration method processEnumInfoForEnumId.
private int processEnumInfoForEnumId(EnumInfo enumInfo) {
Collection<Pool> pools = getAllPools();
ServerConnectivityException lastException = null;
for (Pool pool : pools) {
try {
int result = GetPDXIdForEnumOp.execute((ExecutablePool) pool, enumInfo);
sendEnumIdToPool(enumInfo, result, pool);
return result;
} catch (ServerConnectivityException e) {
// ignore, try the next pool.
lastException = e;
}
}
throw returnCorrectExceptionForFailure(pools, -1, lastException);
}
Aggregations