public static void LogPolicy(Policy p) { Log.debug("Policy: " + "socketTimeout=" + p.socketTimeout + " totalTimeout=" + p.totalTimeout + " maxRetries=" + p.maxRetries + " sleepBetweenRetries=" + p.sleepBetweenRetries); }
public final void addSeeds(Host[] hosts) { // Use copy on write semantics. Host[] seedArray = new Host[seeds.length + hosts.length]; int count = 0; // Add existing seeds. for (Host seed : seeds) { seedArray[count++] = seed; } // Add new seeds for (Host host : hosts) { if (Log.debugEnabled()) { Log.debug("Add seed " + host); } seedArray[count++] = host; } // Replace nodes with copy. seeds = seedArray; }
public final void addSeeds(Host[] hosts) { // Use copy on write semantics. Host[] seedArray = new Host[seeds.length + hosts.length]; int count = 0; // Add existing seeds. for (Host seed : seeds) { seedArray[count++] = seed; } // Add new seeds for (Host host : hosts) { if (Log.debugEnabled()) { Log.debug("Add seed " + host); } seedArray[count++] = host; } // Replace nodes with copy. seeds = seedArray; }
public static void LogPolicy(Policy p) { Log.debug("Policy: " + "socketTimeout=" + p.socketTimeout + " totalTimeout=" + p.totalTimeout + " maxRetries=" + p.maxRetries + " sleepBetweenRetries=" + p.sleepBetweenRetries); }
public LuaValue read() { try { return queue.take(); } catch (InterruptedException ie) { if (Log.debugEnabled()) { Log.debug("LuaInputStream take interrupted"); } return LuaValue.NIL; } }
public LuaValue read() { try { return queue.take(); } catch (InterruptedException ie) { if (Log.debugEnabled()) { Log.debug("LuaInputStream take interrupted"); } return LuaValue.NIL; } }
@Override protected void sendCompleted() { // Send end command to lua thread. // It's critical that the end put succeeds. // Loop through all interrupts. while (true) { try { inputQueue.put(LuaValue.NIL); break; } catch (InterruptedException ie) { if (Log.debugEnabled()) { Log.debug("Lua input queue " + statement.taskId + " put interrupted"); } } } }
@Override protected void sendCompleted() { // Send end command to lua thread. // It's critical that the end put succeeds. // Loop through all interrupts. while (true) { try { inputQueue.put(LuaValue.NIL); break; } catch (InterruptedException ie) { if (Log.debugEnabled()) { Log.debug("Lua input queue " + statement.taskId + " put interrupted"); } } } }
/** * Abort retrieval with end token. */ protected final void abort() { valid = false; queue.clear(); // Send end command to transaction thread. // It's critical that the end offer succeeds. while (! queue.offer(END)) { // Queue must be full. Remove one item to make room. if (queue.poll() == null) { // Can't offer or poll. Nothing further can be done. if (Log.debugEnabled()) { Log.debug("RecordSet " + executor.statement.taskId + " both offer and poll failed on abort"); } break; } } }
/** * Abort retrieval with end token. */ protected final void abort() { valid = false; queue.clear(); // Send end command to transaction thread. // It's critical that the end offer succeeds. while (! queue.offer(END)) { // Queue must be full. Remove one item to make room. if (queue.poll() == null) { // Can't offer or poll. Nothing further can be done. if (Log.debugEnabled()) { Log.debug("ResultSet " + executor.statement.taskId + " both offer and poll failed on abort"); } break; } } }
/** * Abort retrieval with end token. */ protected final void abort() { valid = false; queue.clear(); // Send end command to transaction thread. // It's critical that the end offer succeeds. while (! queue.offer(END)) { // Queue must be full. Remove one item to make room. if (queue.poll() == null) { // Can't offer or poll. Nothing further can be done. if (Log.debugEnabled()) { Log.debug("ResultSet " + executor.statement.taskId + " both offer and poll failed on abort"); } break; } } }
/** * Abort retrieval with end token. */ protected final void abort() { valid = false; queue.clear(); // Send end command to transaction thread. // It's critical that the end offer succeeds. while (! queue.offer(END)) { // Queue must be full. Remove one item to make room. if (queue.poll() == null) { // Can't offer or poll. Nothing further can be done. if (Log.debugEnabled()) { Log.debug("RecordSet " + executor.statement.taskId + " both offer and poll failed on abort"); } break; } } }
/** * Close socket and associated streams. */ public void close() { lastUsed = 0; try { in.close(); out.close(); socket.close(); } catch (Exception e) { if (Log.debugEnabled()) { Log.debug("Error closing socket: " + Util.getErrorMessage(e)); } } }
/** * Close socket and associated streams. */ public void close() { lastUsed = 0; try { in.close(); out.close(); socket.close(); } catch (Exception e) { if (Log.debugEnabled()) { Log.debug("Error closing socket: " + Util.getErrorMessage(e)); } } }
/** * Close socket channel. */ @Override public void close() { if (key != null) { key.cancel(); } try { socketChannel.close(); } catch (Exception e) { if (Log.debugEnabled()) { Log.debug("Error closing socket: " + Util.getErrorMessage(e)); } } } }
/** * Close socket channel. */ @Override public void close() { if (key != null) { key.cancel(); } try { socketChannel.close(); } catch (Exception e) { if (Log.debugEnabled()) { Log.debug("Error closing socket: " + Util.getErrorMessage(e)); } } } }
@Override protected void sendCancel() { // Clear lua input queue to ensure cancel is accepted. inputQueue.clear(); resultSet.abort(); // Send end command to lua input queue. // It's critical that the end offer succeeds. while (! inputQueue.offer(LuaValue.NIL)) { // Queue must be full. Remove one item to make room. if (inputQueue.poll() == null) { // Can't offer or poll. Nothing further can be done. if (Log.debugEnabled()) { Log.debug("Lua input queue " + statement.taskId + " both offer and poll failed on abort"); } break; } } }
@Override protected void sendCancel() { // Clear lua input queue to ensure cancel is accepted. inputQueue.clear(); resultSet.abort(); // Send end command to lua input queue. // It's critical that the end offer succeeds. while (! inputQueue.offer(LuaValue.NIL)) { // Queue must be full. Remove one item to make room. if (inputQueue.poll() == null) { // Can't offer or poll. Nothing further can be done. if (Log.debugEnabled()) { Log.debug("Lua input queue " + statement.taskId + " both offer and poll failed on abort"); } break; } } }
protected final void refreshRacks() { // Do not refresh racks when node connection has already failed during this cluster tend iteration. if (failures > 0 || ! active) { return; } try { if (Log.debugEnabled()) { Log.debug("Update racks for node " + this); } RackParser parser = new RackParser(tendConnection, this); this.rebalanceGeneration = parser.getGeneration(); this.racks = parser.getRacks(); } catch (Exception e) { refreshFailed(e); } }
protected final void refreshRacks() { // Do not refresh racks when node connection has already failed during this cluster tend iteration. if (failures > 0 || ! active) { return; } try { if (Log.debugEnabled()) { Log.debug("Update racks for node " + this); } RackParser parser = new RackParser(tendConnection, this); this.rebalanceGeneration = parser.getGeneration(); this.racks = parser.getRacks(); } catch (Exception e) { refreshFailed(e); } }