本文整理了Java中net.spy.memcached.compat.log.Logger.error()
方法的一些代码示例,展示了Logger.error()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger.error()
方法的具体详情如下:
包路径:net.spy.memcached.compat.log.Logger
类名称:Logger
方法名:error
[英]Log a message at error level.
[中]在错误级别记录消息。
代码示例来源:origin: Netflix/EVCache
public void shutdown() {
removeMonitoring();
writeQ.clear();
readQ.clear();
inputQueue.clear();
try {
// Cleanup the ByteBuffers only if they are sun.nio.ch.DirectBuffer
// If we don't cleanup then we will leak 16K of memory
if (getRbuf() instanceof DirectBuffer) {
Cleaner cleaner = ((DirectBuffer) getRbuf()).cleaner();
if (cleaner != null) cleaner.clean();
cleaner = ((DirectBuffer) getWbuf()).cleaner();
if (cleaner != null) cleaner.clean();
}
} catch (Throwable t) {
getLogger().error("Exception cleaning ByteBuffer.", t);
}
}
代码示例来源:origin: com.couchbase.client/couchbase-client
@Override
public void run() {
try {
ioReactor.execute(ioEventDispatch);
} catch (InterruptedIOException ex) {
getLogger().error("I/O reactor Interrupted", ex);
} catch (IOException e) {
getLogger().error("I/O error: " + e.getMessage(), e);
}
getLogger().debug("I/O reactor terminated");
}
}, "Couchbase ClusterManager Thread");
代码示例来源:origin: com.couchbase.client/couchbase-client
@Override
public void run() {
try {
ioReactor.execute(ioEventDispatch);
} catch (InterruptedIOException ex) {
getLogger().error("I/O reactor Interrupted", ex);
} catch (IOException e) {
getLogger().error("I/O error: " + e.getMessage(), e);
}
getLogger().info("I/O reactor terminated");
}
}, "Couchbase View Thread");
代码示例来源:origin: naver/arcus-java-client
static List<InetSocketAddress> getAddresses(String s) {
List<InetSocketAddress> list = null;
try {
list = parseNodeNames(s);
} catch (Exception e) {
// May see an exception if nodes do not follow the replication naming convention
ArcusClient.arcusLogger.error("Exception caught while parsing node" +
" addresses. cache_list=" + s + "\n" + e);
e.printStackTrace();
list = null;
}
// Return at least one node in all cases. Otherwise we may see unexpected null pointer
// exceptions throughout this client library...
if (list == null || list.size() == 0) {
list = new ArrayList<InetSocketAddress>(1);
list.add((InetSocketAddress) ArcusReplNodeAddress.createFake(null));
}
return list;
}
代码示例来源:origin: com.couchbase.client/couchbase-client
/**
* Helper method to parse a node {@link Status} out of the raw response.
*
* @param status the status to parse.
* @return the parsed status enum value.
*/
private Status parseNodeStatus(String status) {
if (status == null || status.isEmpty()) {
return null;
}
try {
return Status.valueOf(status);
} catch (IllegalArgumentException e) {
getLogger().error("Unknown status value: " + status);
return null;
}
}
代码示例来源:origin: net.spy/spymemcached
/**
* Make sure channel connections are not leaked and properly close under
* faulty reconnect cirumstances.
*
* @param ch the channel to potentially close.
* @param node the node to which the channel should be bound to.
*/
private void potentiallyCloseLeakingChannel(final SocketChannel ch,
final MemcachedNode node) {
if (ch != null && !ch.isConnected() && !ch.isConnectionPending()) {
try {
ch.close();
} catch (IOException e) {
getLogger().error("Exception closing channel: %s", node, e);
}
}
}
代码示例来源:origin: com.amazonaws/elasticache-java-cluster-client
/**
* Make sure channel connections are not leaked and properly close under
* faulty reconnect cirumstances.
*
* @param ch the channel to potentially close.
* @param node the node to which the channel should be bound to.
*/
private void potentiallyCloseLeakingChannel(final SocketChannel ch,
final MemcachedNode node) {
if (ch != null && !ch.isConnected() && !ch.isConnectionPending()) {
try {
ch.close();
} catch (IOException e) {
getLogger().error("Exception closing channel: %s", node, e);
}
}
}
代码示例来源:origin: com.couchbase.client/couchbase-client
/**
* Shuts down the active {@link ViewConnection}.
*
* @return false if a shutdown attempt is already in progress, true otherwise.
* @throws IOException if the reactor cannot be shut down properly.
*/
public boolean shutdown() throws IOException {
if (!running) {
getLogger().info("Suppressing duplicate attempt to shut down");
return false;
}
running = false;
ioReactor.shutdown();
try {
reactorThread.join(0);
} catch (InterruptedException ex) {
getLogger().error("Interrupt " + ex + " received while waiting for "
+ "view thread to shut down.");
}
return true;
}
代码示例来源:origin: com.amazonaws/elasticache-java-cluster-client
/**
* Set the continuous timeout on an operation.
*
* Ignore operations which have no handling nodes set yet (which may happen before nodes are properly
* authenticated).
*
* @param op the operation to use.
* @param isTimeout is timed out or not.
*/
private static void setTimeout(final Operation op, final boolean isTimeout) {
Logger logger = LoggerFactory.getLogger(MemcachedConnection.class);
try {
if (op == null || op.isTimedOutUnsent()) {
return;
}
MemcachedNode node = op.getHandlingNode();
if (node != null) {
node.setContinuousTimeout(isTimeout);
}
} catch (Exception e) {
logger.error(e.getMessage());
}
}
代码示例来源:origin: net.spy/spymemcached
public Long decode(CachedData d) {
if (FLAGS == d.getFlags()) {
return tu.decodeLong(d.getData());
} else {
getLogger().error(
"Unexpected flags for long: " + d.getFlags() + " wanted " + FLAGS);
return null;
}
}
代码示例来源:origin: com.google.code.simple-spring-memcached/spymemcached
public Long decode(CachedData d) {
if (FLAGS == d.getFlags()) {
return tu.decodeLong(d.getData());
} else {
getLogger().error(
"Unexpected flags for long: " + d.getFlags() + " wanted " + FLAGS);
return null;
}
}
代码示例来源:origin: com.amazonaws/elasticache-java-cluster-client
public Long decode(CachedData d) {
if (FLAGS == d.getFlags()) {
return tu.decodeLong(d.getData());
} else {
getLogger().error(
"Unexpected flags for long: " + d.getFlags() + " wanted " + FLAGS);
return null;
}
}
代码示例来源:origin: com.google.code.maven-play-plugin.spy/memcached
public Long decode(CachedData d) {
if (flags == d.getFlags()) {
return tu.decodeLong(d.getData());
} else {
getLogger().error("Unexpected flags for long: "
+ d.getFlags() + " wanted " + flags);
return null;
}
}
代码示例来源:origin: com.google.code.maven-play-plugin.spy/spymemcached
public Long decode(CachedData d) {
if (flags == d.getFlags()) {
return tu.decodeLong(d.getData());
} else {
getLogger().error("Unexpected flags for long: "
+ d.getFlags() + " wanted " + flags);
return null;
}
}
代码示例来源:origin: naver/arcus-java-client
public Long decode(CachedData d) {
if (flags == d.getFlags()) {
return tu.decodeLong(d.getData());
} else {
getLogger().error("Unexpected flags for long: "
+ d.getFlags() + " wanted " + flags);
return null;
}
}
代码示例来源:origin: com.google.code.maven-play-plugin.spy/spymemcached
protected void handleError(OperationErrorType eType, String line)
throws IOException {
getLogger().error("Error: %s", line);
switch(eType) {
case GENERAL:
exception=new OperationException();
break;
case SERVER:
exception=new OperationException(eType, line);
break;
case CLIENT:
exception=new OperationException(eType, line);
break;
default: assert false;
}
transitionState(OperationState.COMPLETE);
throw exception;
}
代码示例来源:origin: com.couchbase.client/couchbase-client
@Override
public void handleResponse(HttpResponse response) {
String json = getEntityString(response);
int errorcode = response.getStatusLine().getStatusCode();
try {
OperationStatus status = parseViewForStatus(json, errorcode);
ViewResponse vr = null;
if (status.isSuccess()) {
vr = parseResult(json);
} else {
parseError(json, errorcode);
}
((ViewCallback) callback).gotData(vr);
callback.receivedStatus(status);
} catch (ParseException e) {
LOGGER.error("Failed to parse JSON in response: " + response + ": " + json);
setException(new OperationException(OperationErrorType.GENERAL,
"Error parsing JSON (" + e.getMessage() + "): " + json));
}
callback.complete();
}
代码示例来源:origin: com.google.code.maven-play-plugin.spy/memcached
protected void handleError(OperationErrorType eType, String line)
throws IOException {
getLogger().error("Error: %s", line);
switch(eType) {
case GENERAL:
exception=new OperationException();
break;
case SERVER:
exception=new OperationException(eType, line);
break;
case CLIENT:
exception=new OperationException(eType, line);
break;
default: assert false;
}
transitionState(OperationState.COMPLETE);
throw exception;
}
代码示例来源:origin: com.google.code.simple-spring-memcached/spymemcached
protected void handleError(OperationErrorType eType, String line)
throws IOException {
getLogger().error("Error: %s", line);
switch (eType) {
case GENERAL:
exception = new OperationException();
break;
case SERVER:
exception = new OperationException(eType, line);
break;
case CLIENT:
exception = new OperationException(eType, line);
break;
default:
assert false;
}
callback.receivedStatus(new OperationStatus(false,
exception.getMessage()));
transitionState(OperationState.COMPLETE);
throw exception;
}
代码示例来源:origin: com.amazonaws/elasticache-java-cluster-client
protected void handleError(OperationErrorType eType, String line)
throws IOException {
getLogger().error("Error: %s", line);
switch (eType) {
case GENERAL:
exception = new OperationException();
break;
case SERVER:
exception = new OperationException(eType, line);
break;
case CLIENT:
exception = new OperationException(eType, line);
break;
default:
assert false;
}
callback.receivedStatus(new OperationStatus(false,
exception.getMessage(), StatusCode.ERR_INTERNAL));
transitionState(OperationState.COMPLETE);
throw exception;
}
内容来源于网络,如有侵权,请联系作者删除!