Java 类com.hazelcast.core.OperationTimeoutException 实例源码

项目:docker-hazelcast-mapstore-cassandra    文件:HazelcastWorker.java   
public Collection<User> getUsersByFirstName(final String firstName) {

    log.info("Finding user with firtname {}.", firstName);
    // retrieve interested subscriber types
    Collection<User> users = Collections.EMPTY_SET;

    try {
      final UserByFirstNamePredicate predicate = new UserByFirstNamePredicate(
          firstName);
      users = usersMap.getAll(usersMap.keySet(predicate)).values();
      log.info("Found {} users with firstname {} .", users.size(), firstName);

    } catch (OperationTimeoutException ote) {
      log.error("Hazelcast cluster is borked, so return empty set", ote);
    }

    return users;
  }
项目:hazelcast-mapstore-postgres-cassandra    文件:HazelcastWorker.java   
public Collection<User> getUsersByFirstName(final String firstName) {

    log.info("Finding user with firtname {}.", firstName);
    // retrieve interested subscriber types
    Collection<User> users = Collections.EMPTY_SET;

    try {
      final UserByFirstNamePredicate predicate = new UserByFirstNamePredicate(
          firstName);
      users = usersMap.getAll(usersMap.keySet(predicate)).values();
      log.info("Found {} users with firstname {} .", users.size(), firstName);

    } catch (OperationTimeoutException ote) {
      log.error("Hazelcast cluster is borked, so return empty set", ote);
    }

    return users;
  }
项目:whois    文件:HazelcastPersonalObjectAccounting.java   
@Override
public int getQueriedPersonalObjects(final InetAddress remoteAddress) {
    Integer count = null;
    try {
        count = counterMap.get(remoteAddress);
    } catch (OperationTimeoutException | IllegalStateException e) {
        // no answer from hazelcast, expected, don't rethrow
        LOGGER.debug("{}: {}", e.getClass().getName(), e.getMessage());
    }

    if (count == null) {
        return 0;
    }

    return count;
}
项目:hazelcast-hibernate5    文件:AbstractGeneralRegion.java   
@Override
public void evict(final Object key) throws CacheException {
    try {
        getCache().remove(key);
    } catch (OperationTimeoutException e) {
        Logger.getLogger(AbstractGeneralRegion.class).finest(e);
    }
}
项目:hazelcast-hibernate5    文件:AbstractGeneralRegion.java   
@Override
public void evictAll() throws CacheException {
    try {
        getCache().clear();
    } catch (OperationTimeoutException e) {
        Logger.getLogger(AbstractGeneralRegion.class).finest(e);
    }
}
项目:hazelcast-hibernate5    文件:AbstractGeneralRegion.java   
@Override
public Object get(final SessionImplementor session, final Object key) throws CacheException {
    try {
        return getCache().get(key, nextTimestamp());
    } catch (OperationTimeoutException e) {
        return null;
    }
}
项目:hazelcast-hibernate5    文件:AbstractGeneralRegion.java   
@Override
public void put(final SessionImplementor session, final Object key, final Object value) throws CacheException {
    try {
        getCache().put(key, value, nextTimestamp(), null);
    } catch (OperationTimeoutException e) {
        Logger.getLogger(AbstractGeneralRegion.class).finest(e);
    }
}
项目:hazelcast-hibernate5    文件:HazelcastTimestampsRegionTest.java   
@Test
public void testPut_withException() {
    doThrow(new OperationTimeoutException("expected exception"))
            .when(cache).put(eq("putKey"), eq("putValue"), anyLong(), any());
    region.put(null, "putKey", "putValue");
    verify(cache).put(eq("putKey"), eq("putValue"), anyLong(), any());
}
项目:hazelcast-hibernate5    文件:AbstractGeneralRegion.java   
@Override
public void evict(final Object key) throws CacheException {
    try {
        getCache().remove(key);
    } catch (OperationTimeoutException e) {
        Logger.getLogger(AbstractGeneralRegion.class).finest(e);
    }
}
项目:hazelcast-hibernate5    文件:AbstractGeneralRegion.java   
@Override
public void evictAll() throws CacheException {
    try {
        getCache().clear();
    } catch (OperationTimeoutException e) {
        Logger.getLogger(AbstractGeneralRegion.class).finest(e);
    }
}
项目:hazelcast-hibernate5    文件:AbstractGeneralRegion.java   
@Override
public Object get(final SharedSessionContractImplementor session, final Object key) throws CacheException {
    try {
        return getCache().get(key, nextTimestamp());
    } catch (OperationTimeoutException e) {
        return null;
    }
}
项目:hazelcast-hibernate5    文件:AbstractGeneralRegion.java   
@Override
public void put(final SharedSessionContractImplementor session, final Object key, final Object value) throws CacheException {
    try {
        getCache().put(key, value, nextTimestamp(), null);
    } catch (OperationTimeoutException e) {
        Logger.getLogger(AbstractGeneralRegion.class).finest(e);
    }
}
项目:hazelcast-hibernate    文件:AbstractGeneralRegion.java   
public void evict(final Object key) throws CacheException {
    try {
        getCache().remove(key);
    } catch (OperationTimeoutException e) {
        Logger.getLogger(AbstractGeneralRegion.class).finest(e);
    }
}
项目:hazelcast-hibernate    文件:AbstractGeneralRegion.java   
public void evictAll() throws CacheException {
    try {
        getCache().clear();
    } catch (OperationTimeoutException e) {
        Logger.getLogger(AbstractGeneralRegion.class).finest(e);
    }
}
项目:hazelcast-hibernate    文件:AbstractGeneralRegion.java   
public Object get(final Object key) throws CacheException {
    try {
        return getCache().get(key, nextTimestamp());
    } catch (OperationTimeoutException e) {
        return null;
    }
}
项目:hazelcast-hibernate    文件:AbstractGeneralRegion.java   
public void put(final Object key, final Object value) throws CacheException {
    try {
        getCache().put(key, value, nextTimestamp(), null);
    } catch (OperationTimeoutException e) {
        Logger.getLogger(AbstractGeneralRegion.class).finest(e);
    }
}
项目:hazelcast-hibernate    文件:HazelcastTimestampsRegionTest.java   
@Test
public void testPut_withException() {
    doThrow(new OperationTimeoutException("expected exception"))
            .when(cache).put(eq("putKey"), eq("putValue"), anyLong(), any());
    region.put("putKey", "putValue");
    verify(cache).put(eq("putKey"), eq("putValue"), anyLong(), any());
}
项目:hazelcast-hibernate    文件:AbstractGeneralRegion.java   
@Override
public void evict(final Object key) throws CacheException {
    try {
        getCache().remove(key);
    } catch (OperationTimeoutException e) {
        Logger.getLogger(AbstractGeneralRegion.class).finest(e);
    }
}
项目:hazelcast-hibernate    文件:AbstractGeneralRegion.java   
@Override
public void evictAll() throws CacheException {
    try {
        getCache().clear();
    } catch (OperationTimeoutException e) {
        Logger.getLogger(AbstractGeneralRegion.class).finest(e);
    }
}
项目:hazelcast-hibernate    文件:AbstractGeneralRegion.java   
@Override
public Object get(final Object key) throws CacheException {
    try {
        return getCache().get(key, nextTimestamp());
    } catch (OperationTimeoutException e) {
        return null;
    }
}
项目:hazelcast-hibernate    文件:AbstractGeneralRegion.java   
@Override
public void put(final Object key, final Object value) throws CacheException {
    try {
        getCache().put(key, value, nextTimestamp(), null);
    } catch (OperationTimeoutException e) {
        Logger.getLogger(AbstractGeneralRegion.class).finest(e);
    }
}
项目:hazelcast-hibernate    文件:HazelcastTimestampsRegionTest.java   
@Test
public void testPut_withException() {
    doThrow(new OperationTimeoutException("expected exception"))
            .when(cache).put(eq("putKey"), eq("putValue"), anyLong(), any());
    region.put("putKey", "putValue");
    verify(cache).put(eq("putKey"), eq("putValue"), anyLong(), any());
}
项目:health-and-care-developer-network    文件:AbstractGeneralRegion.java   
public Object get(final Object key) throws CacheException {
    try {
        return getCache().get(key);
    } catch (OperationTimeoutException e) {
        return null;
    }
}
项目:health-and-care-developer-network    文件:ExecutorManager.java   
public void get(long time, TimeUnit unit) throws InterruptedException {
    Object result = null;
    boolean done = true;
    try {
        result = doGetResult((time == -1) ? -1 : unit.toMillis(time));
        if (result == OBJECT_NO_RESPONSE || result == OBJECT_REDO) {
            done = false;
            innerFutureTask.innerSetException(new TimeoutException(), false);
        } else if (result instanceof CancellationException) {
            innerFutureTask.innerSetCancelled();
        } else if (result == OBJECT_MEMBER_LEFT) {
            innerFutureTask.innerSetMemberLeft(member);
        } else if (result instanceof Throwable) {
            innerFutureTask.innerSetException((Throwable) result, true);
        } else {
            innerFutureTask.innerSet(result);
        }
    } catch (Exception e) {
        if (time > 0 && e instanceof OperationTimeoutException) {
            e = new TimeoutException();
        }
        innerFutureTask.innerSetException(e, done);
    } finally {
        if (singleTask && done) {
            innerFutureTask.innerDone();
        }
    }
}
项目:hazelcast-hibernate5    文件:HazelcastTimestampsRegionTest.java   
@Test
public void testEvict_withException() {
    doThrow(new OperationTimeoutException("expected exception")).when(cache).remove(eq("evictionKey"));
    region.evict("evictionKey");
}
项目:hazelcast-hibernate5    文件:HazelcastTimestampsRegionTest.java   
@Test
public void testEvictAll_withException() {
    doThrow(new OperationTimeoutException("expected exception")).when(cache).clear();
    region.evictAll();
}
项目:hazelcast-hibernate5    文件:HazelcastTimestampsRegionTest.java   
@Test
public void testGet_withException() {
    doThrow(new OperationTimeoutException("expected exception")).when(cache).get(eq("getKey"), anyLong());
    assertNull(region.get(null, "getKey"));
}
项目:hazelcast-hibernate    文件:HazelcastTimestampsRegionTest.java   
@Test
public void testEvict_withException() {
    doThrow(new OperationTimeoutException("expected exception")).when(cache).remove(eq("evictionKey"));
    region.evict("evictionKey");
}
项目:hazelcast-hibernate    文件:HazelcastTimestampsRegionTest.java   
@Test
public void testEvictAll_withException() {
    doThrow(new OperationTimeoutException("expected exception")).when(cache).clear();
    region.evictAll();
}
项目:hazelcast-hibernate    文件:HazelcastTimestampsRegionTest.java   
@Test
public void testGet_withException() {
    doThrow(new OperationTimeoutException("expected exception")).when(cache).get(eq("getKey"), anyLong());
    assertNull(region.get("getKey"));
}
项目:hazelcast-hibernate    文件:HazelcastTimestampsRegionTest.java   
@Test
public void testEvict_withException() {
    doThrow(new OperationTimeoutException("expected exception")).when(cache).remove(eq("evictionKey"));
    region.evict("evictionKey");
    verify(cache).remove(eq("evictionKey"));
}
项目:hazelcast-hibernate    文件:HazelcastTimestampsRegionTest.java   
@Test
public void testEvictAll_withException() {
    doThrow(new OperationTimeoutException("expected exception")).when(cache).clear();
    region.evictAll();
    verify(cache).clear();
}
项目:hazelcast-hibernate    文件:HazelcastTimestampsRegionTest.java   
@Test
public void testGet_withException() {
    doThrow(new OperationTimeoutException("expected exception")).when(cache).get(eq("getKey"), anyLong());
    assertNull(region.get("getKey"));
    verify(cache).get(eq("getKey"), anyLong());
}
项目:health-and-care-developer-network    文件:AbstractGeneralRegion.java   
public void evict(final Object key) throws CacheException {
    try {
        getCache().remove(key);
    } catch (OperationTimeoutException ignored) {
    }
}
项目:health-and-care-developer-network    文件:AbstractGeneralRegion.java   
public void evictAll() throws CacheException {
    try {
        getCache().clear();
    } catch (OperationTimeoutException ignored) {
    }
}
项目:health-and-care-developer-network    文件:AbstractGeneralRegion.java   
public void put(final Object key, final Object value) throws CacheException {
    try {
        getCache().put(key, value, null);
    } catch (OperationTimeoutException ignored) {
    }
}