本文整理汇总了Java中com.hazelcast.util.ExceptionUtil.rethrow方法的典型用法代码示例。如果您正苦于以下问题:Java ExceptionUtil.rethrow方法的具体用法?Java ExceptionUtil.rethrow怎么用?Java ExceptionUtil.rethrow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.hazelcast.util.ExceptionUtil
的用法示例。
在下文中一共展示了ExceptionUtil.rethrow方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMembers
import com.hazelcast.util.ExceptionUtil; //导入方法依赖的package包/类
@Override
protected Collection<String> getMembers() {
try {
Collection<String> list = aws.getPrivateIpAddresses();
if (list.isEmpty()) {
logger.warning("No EC2 instances found!");
} else {
if (logger.isFinestEnabled()) {
StringBuilder sb = new StringBuilder("Found the following EC2 instances:\n");
for (String ip : list) {
sb.append(" ").append(ip).append("\n");
}
logger.finest(sb.toString());
}
}
return list;
} catch (Exception e) {
logger.warning(e);
throw ExceptionUtil.rethrow(e);
}
}
示例2: build
import com.hazelcast.util.ExceptionUtil; //导入方法依赖的package包/类
@Override
public MapReduceTask<KeyIn, ValueIn, KeyOut, ValueOut> build( IMap<KeyIn, ValueIn> map )
{
try
{
ClientMapProxy<KeyIn, ValueIn> proxy = (ClientMapProxy<KeyIn, ValueIn>) map;
ClientContext context = (ClientContext) GET_CLIENTCONTEXT_METHOD.invoke( proxy );
return new IMapClientMapReduceTaskProxy<KeyIn, ValueIn, KeyOut, ValueOut>( proxy.getName(), context,
hazelcastInstance );
}
catch ( Throwable t )
{
ExceptionUtil.rethrow( t );
}
return null;
}
示例3: build
import com.hazelcast.util.ExceptionUtil; //导入方法依赖的package包/类
@Override
public MapReduceTask<KeyIn, ValueIn, KeyOut, ValueOut> build( IMap<KeyIn, ValueIn> map )
{
try
{
MapProxyImpl<KeyIn, ValueIn> proxy = (MapProxyImpl<KeyIn, ValueIn>) map;
NodeEngine nodeEngine = hazelcastInstance.node.nodeEngine;
return new IMapNodeMapReduceTaskImpl<KeyIn, ValueIn, KeyOut, ValueOut>( proxy.getName(), nodeEngine,
hazelcastInstance );
}
catch ( Throwable t )
{
ExceptionUtil.rethrow( t );
}
return null;
}
示例4: run
import com.hazelcast.util.ExceptionUtil; //导入方法依赖的package包/类
@Override
public void run()
{
try
{
Map<Integer, Object> responses = invokeTasks( isDistributableReducer() );
Map groupedResponses = groupResponsesByKey( responses );
Map reducedResults = finalReduceStep( groupedResponses );
if ( collator == null )
{
listener.onCompletion( reducedResults );
}
else
{
R result = collator.collate( reducedResults );
collatorListener.onCompletion( result );
}
}
catch ( Throwable t )
{
ExceptionUtil.rethrow( t );
}
}
示例5: submit
import com.hazelcast.util.ExceptionUtil; //导入方法依赖的package包/类
@Override
public Map<KeyIn, ValueIn> submit()
{
List<KeyIn> keys = buildKeys();
try
{
Map<Integer, Object> responses;
if ( keys != null )
{
responses = invokeTasks( keys, isDistributableReducer() );
}
else
{
responses = invokeTasks( isDistributableReducer() );
}
Map<KeyOut, List<ValueOut>> groupedResponses = groupResponsesByKey( responses );
return (Map<KeyIn, ValueIn>) finalReduceStep( groupedResponses );
}
catch ( Throwable t )
{
ExceptionUtil.rethrow( t );
}
return Collections.emptyMap();
}
示例6: ClusteredSessionService
import com.hazelcast.util.ExceptionUtil; //导入方法依赖的package包/类
/**
* Instantiates a new Clustered session service.
*
* @param filterConfig the filter config
*/
public ClusteredSessionService(WebFilterConfig filterConfig) {
this.filterConfig = filterConfig;
try {
init();
} catch (Exception e) {
ExceptionUtil.rethrow(e);
}
}
示例7: setAttributes
import com.hazelcast.util.ExceptionUtil; //导入方法依赖的package包/类
private void setAttributes(Object attributes) {
try {
ATTRIBUTES_FIELD.set(this, attributes);
} catch (IllegalAccessException e) {
ExceptionUtil.rethrow(e);
}
}
示例8: getMembers
import com.hazelcast.util.ExceptionUtil; //导入方法依赖的package包/类
/**
* Get a list of all members.
*
* @return a collection with all members
*/
@Override
protected Collection<String> getMembers() {
Collection<String> list = new LinkedList<>();
String name = consulConfig.getName();
try {
ConsulResponse<List<CatalogService>> service = this.agentClient.getService(name);
logger.info("Resolving service: " + name);
for (CatalogService s : service.getResponse()) {
if (logger.isFinestEnabled()) {
logger.finest("Found service at: " + s.getAddress());
}
list.add(s.getAddress());
}
if (list.isEmpty()) {
logger.info("No services found!");
}
return list;
} catch (Exception e) {
logger.warning(e);
throw ExceptionUtil.rethrow(e);
}
}
示例9: discoverNodes
import com.hazelcast.util.ExceptionUtil; //导入方法依赖的package包/类
@Override
public Collection<DiscoveredNode> discoverNodes() {
Collection<DiscoveredNode> list = new LinkedList<>();
Properties empty = new Properties();
if (this.agentClient != null) {
try {
ConsulResponse<List<CatalogService>> service = this.agentClient.getService(serviceName);
LOG.log(Level.WARNING, "Resolving service: {0}", serviceName);
for (CatalogService s : service.getResponse()) {
if (LOG.isLoggable(Level.FINEST)) {
LOG.log(Level.FINEST, "Found service at: {0}", s.getAddress());
}
Address address = new Address(s.getAddress(), s.getServicePort());
list.add(new SimpleDiscoveredNode(address, empty));
}
if (list.isEmpty()) {
LOG.warning("No consul instances found!");
}
return list;
} catch (Exception e) {
LOG.severe(e.getMessage());
throw ExceptionUtil.rethrow(e);
}
}
return list;
}
示例10: invoke
import com.hazelcast.util.ExceptionUtil; //导入方法依赖的package包/类
@Nonnull
@Override
public ICompletableFuture<ClientMessage> invoke(@Nonnegative int partitionId, @Nonnull ClientMessage request) {
try {
ClientInvocation clientInvocation = new ClientInvocation(client, request, partitionId);
return clientInvocation.invoke();
} catch (Exception e) {
throw ExceptionUtil.rethrow(e);
}
}
示例11: asyncInvoke
import com.hazelcast.util.ExceptionUtil; //导入方法依赖的package包/类
private <E> InternalCompletableFuture<E> asyncInvoke(Operation operation) {
try {
OperationService operationService = getNodeEngine().getOperationService();
return (InternalCompletableFuture<E>) operationService.invokeOnPartition(
TreeMapService.SERVICE_NAME, operation, partitionId);
} catch (Throwable throwable) {
throw ExceptionUtil.rethrow(throwable);
}
}
示例12: asyncInvoke
import com.hazelcast.util.ExceptionUtil; //导入方法依赖的package包/类
private <E> InternalCompletableFuture<E> asyncInvoke(Operation operation) {
try {
OperationService operationService = getNodeEngine().getOperationService();
return (InternalCompletableFuture<E>) operationService.invokeOnPartition(
HyperLogLogService.SERVICE_NAME, operation, partitionId);
} catch (Throwable throwable) {
throw ExceptionUtil.rethrow(throwable);
}
}
示例13: invokeOperation
import com.hazelcast.util.ExceptionUtil; //导入方法依赖的package包/类
private Object invokeOperation(Data key, KeyBasedMapOperation operation) {
final NodeEngine nodeEngine = getNodeEngine();
int partitionId = nodeEngine.getPartitionService().getPartitionId(key);
operation.setThreadId(ThreadUtil.getThreadId());
try {
Future f;
Object o;
OperationService operationService = nodeEngine.getOperationService();
if (mapConfig.isStatisticsEnabled()) {
long time = System.currentTimeMillis();
f = operationService
.createInvocationBuilder(SERVICE_NAME, operation, partitionId)
.setResultDeserialized(false)
.invoke();
o = f.get();
if (operation instanceof BasePutOperation)
localMapStats.incrementPuts(System.currentTimeMillis() - time);
else if (operation instanceof BaseRemoveOperation)
localMapStats.incrementRemoves(System.currentTimeMillis() - time);
else if (operation instanceof GetOperation)
localMapStats.incrementGets(System.currentTimeMillis() - time);
} else {
f = operationService.createInvocationBuilder(SERVICE_NAME, operation, partitionId)
.setResultDeserialized(false).invoke();
o = f.get();
}
return o;
} catch (Throwable t) {
throw ExceptionUtil.rethrow(t);
}
}
示例14: getCallable
import com.hazelcast.util.ExceptionUtil; //导入方法依赖的package包/类
/**
* since this operation handles responses in an async way, we need to handle serialization exceptions too
*
* @return
*/
private Callable getCallable() {
try {
return getNodeEngine().toObject(callableData);
} catch (HazelcastSerializationException e) {
getResponseHandler().sendResponse(e);
throw ExceptionUtil.rethrow(e);
}
}
示例15: buildMapReduceTaskBuilder
import com.hazelcast.util.ExceptionUtil; //导入方法依赖的package包/类
private MapReduceTaskBuilder buildMapReduceTaskBuilder( HazelcastInstance hazelcastInstance )
{
try
{
String canonicalClassName = hazelcastInstance.getClass().getCanonicalName();
String className;
if ( NODE_HI_CLASS.equals( canonicalClassName ) )
{
className = "com.noctarius.castmapr.NodeMapReduceTaskBuilder";
}
else if ( CLIENT_HI_CLASS.equals( canonicalClassName ) )
{
className = "com.noctarius.castmapr.ClientMapReduceTaskBuilder";
}
else
{
throw new IllegalArgumentException( "Unknown HazelcastInstance implementation found." );
}
Class<? extends MapReduceTaskBuilder> builderClass;
builderClass = (Class<? extends MapReduceTaskBuilder>) classLoader.loadClass( className );
Constructor<MapReduceTaskBuilder> constructor;
constructor =
(Constructor<MapReduceTaskBuilder>) builderClass.getDeclaredConstructor( HazelcastInstance.class );
return constructor.newInstance( hazelcastInstance );
}
catch ( Throwable t )
{
ExceptionUtil.rethrow( t );
}
return null;
}