@Override public Object getDataValue() { String dataType = getDataType(); if (dataType == null || dataType.equals("N/A")) { return null; } else if (isCompressed()) { return ((OffHeapStoredObject) this.block).getCompressedBytes(); } else if (!isSerialized()) { // byte array // return "byte[" + ((Chunk)this.block).getDataSize() + "]"; return ((OffHeapStoredObject) this.block).getRawBytes(); } else { try { byte[] bytes = ((OffHeapStoredObject) this.block).getRawBytes(); return DataSerializer.readObject(DataType.getDataInput(bytes)); } catch (IOException e) { e.printStackTrace(); return "IOException:" + e.getMessage(); } catch (ClassNotFoundException e) { e.printStackTrace(); return "ClassNotFoundException:" + e.getMessage(); } catch (CacheClosedException e) { e.printStackTrace(); return "CacheClosedException:" + e.getMessage(); } } }
@Test public void getCacheClosedExceptionWhenCauseGivenButDisconnectExceptionExistsPrefersCause() { cache = GemFireCacheImpl.create(distributedSystem, cacheConfig); cache.disconnectCause = new Throwable("disconnectCause"); Throwable cause = new Throwable(); CacheClosedException e = cache.getCacheClosedException("message", cause); assertThat(e.getCause()).isEqualTo(cause); assertThat(e.getMessage()).isEqualTo("message"); }
@Test public void getCacheClosedExceptionWhenNoCauseGivenProvidesDisconnectExceptionIfExists() { cache = GemFireCacheImpl.create(distributedSystem, cacheConfig); Throwable disconnectCause = new Throwable("disconnectCause"); cache.disconnectCause = disconnectCause; CacheClosedException e = cache.getCacheClosedException("message", null); assertThat(e.getCause()).isEqualTo(disconnectCause); assertThat(e.getMessage()).isEqualTo("message"); }
@Test public void getCacheClosedExceptionReturnsExceptionWithProvidedCauseAndReason() { cache = GemFireCacheImpl.create(distributedSystem, cacheConfig); Throwable cause = new Throwable(); CacheClosedException e = cache.getCacheClosedException("message", cause); assertThat(e.getCause()).isEqualTo(cause); assertThat(e.getMessage()).isEqualTo("message"); }
@Test public void getCacheClosedExceptionReturnsExceptionWithDisconnectCause() { cache = GemFireCacheImpl.create(distributedSystem, cacheConfig); Throwable disconnectCause = new Throwable("disconnectCause"); cache.disconnectCause = disconnectCause; CacheClosedException e = cache.getCacheClosedException("message"); assertThat(e.getMessage()).isEqualTo("message"); assertThat(e.getCause()).isEqualTo(disconnectCause); }
@Test public void getCacheClosedExceptionWithNoCauseGivesExceptionWithReason() { cache = GemFireCacheImpl.create(distributedSystem, cacheConfig); CacheClosedException e = cache.getCacheClosedException("message", null); assertThat(e.getCause()).isNull(); assertThat(e.getMessage()).isEqualTo("message"); }
@Test public void getCacheClosedExceptionReturnsExceptionWithProvidedReason() { cache = GemFireCacheImpl.create(distributedSystem, cacheConfig); CacheClosedException e = cache.getCacheClosedException("message"); assertThat(e.getMessage()).isEqualTo("message"); assertThat(e.getCause()).isNull(); }
@Test public void getCacheClosedExceptionReturnsExceptionWithNoMessageWhenReasonNotGiven() { cache = GemFireCacheImpl.create(distributedSystem, cacheConfig); CacheClosedException e = cache.getCacheClosedException(null); assertThat(e.getMessage()).isEqualTo(null); assertThat(e.getCause()).isNull(); }
logger.debug(ccex.getMessage(), ccex);
@Test public void getCacheClosedExceptionWithNoReasonOrCauseGivesExceptionWithoutEither() { cache = GemFireCacheImpl.create(distributedSystem, cacheConfig); CacheClosedException e = cache.getCacheClosedException(null, null); assertThat(e.getCause()).isNull(); assertThat(e.getMessage()).isNull(); }
result = ResultModel.createMemberStatusResult((List<CliFunctionResult>) rc.getResult()); } catch (CacheClosedException e) { result = ResultModel.createError(e.getMessage()); } catch (FunctionInvocationTargetException e) { result = ResultModel.createError(
FunctionInvocationTargetException fite = new InternalFunctionInvocationTargetException( ((CacheClosedException) result).getMessage()); if (resultResponse instanceof ArrayList) { DistributedMember memberID = (DistributedMember) ((List) resultResponse).get(1);
partitionedRegion.getFullPath(), cce.getMessage()); } catch (CancelException ce) { logger.debug("Encounter CancelException when shutDownAll is closing PR: {}:{}",
result = ResultModel.createMemberStatusResult((List<CliFunctionResult>) rc.getResult()); } catch (CacheClosedException e) { result = ResultModel.createError(e.getMessage()); } catch (FunctionInvocationTargetException e) { result = ResultModel.createError(
if (isHA) { fite = new InternalFunctionInvocationTargetException( ((CacheClosedException) result).getMessage()); } else { fite = new FunctionInvocationTargetException( ((CacheClosedException) result).getMessage());
result = new CliFunctionResult(memberId, e, e.getMessage()); } catch (Exception e) { result = new CliFunctionResult(memberId, e, e.getMessage());
|| execution instanceof MultiRegionFunctionExecutor) || !fn.isHA()) { FunctionInvocationTargetException fite = new FunctionInvocationTargetException(e.getMessage()); throw new FunctionException(fite); } else if (execution.isClientServerMode()) { clearResults(); FunctionInvocationTargetException fite = new InternalFunctionInvocationTargetException(e.getMessage()); throw new FunctionException(fite); } else {
|| execution instanceof MultiRegionFunctionExecutor) || !fn.isHA()) { FunctionInvocationTargetException fite = new FunctionInvocationTargetException(e.getMessage()); throw new FunctionException(fite); } else if (execution.isClientServerMode()) { clearResults(); FunctionInvocationTargetException fite = new InternalFunctionInvocationTargetException(e.getMessage()); throw new FunctionException(fite); } else {
new FunctionInvocationTargetException(e.getMessage()); throw new FunctionException(fite); } else if (execution.isClientServerMode()) { e.getMessage(), this.execution.getFailedNodes()); throw new FunctionException(fite); } else {
new FunctionInvocationTargetException(e.getMessage()); throw new FunctionException(fite); } else if (execution.isClientServerMode()) { e.getMessage(), this.execution.getFailedNodes()); throw new FunctionException(fite); } else {