mirror of https://github.com/apache/cassandra
fix minor logging issues
This commit is contained in:
parent
4864ccf618
commit
5d4335e8f8
|
|
@ -54,7 +54,7 @@ public final class DateTieredCompactionStrategyOptions
|
|||
String optionValue = options.get(TIMESTAMP_RESOLUTION_KEY);
|
||||
timestampResolution = optionValue == null ? DEFAULT_TIMESTAMP_RESOLUTION : TimeUnit.valueOf(optionValue);
|
||||
if (timestampResolution != DEFAULT_TIMESTAMP_RESOLUTION)
|
||||
logger.warn("Using a non-default timestamp_resolution {} - are you really doing inserts with USING TIMESTAMP <non_microsecond_timestamp> (or driver equivalent)?", timestampResolution.toString());
|
||||
logger.warn("Using a non-default timestamp_resolution {} - are you really doing inserts with USING TIMESTAMP <non_microsecond_timestamp> (or driver equivalent)?", timestampResolution);
|
||||
optionValue = options.get(MAX_SSTABLE_AGE_KEY);
|
||||
double fractionalDays = optionValue == null ? DEFAULT_MAX_SSTABLE_AGE_DAYS : Double.parseDouble(optionValue);
|
||||
maxSSTableAge = Math.round(fractionalDays * timestampResolution.convert(1, TimeUnit.DAYS));
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ public final class TimeWindowCompactionStrategyOptions
|
|||
String optionValue = options.get(TIMESTAMP_RESOLUTION_KEY);
|
||||
timestampResolution = optionValue == null ? DEFAULT_TIMESTAMP_RESOLUTION : TimeUnit.valueOf(optionValue);
|
||||
if (timestampResolution != DEFAULT_TIMESTAMP_RESOLUTION)
|
||||
logger.warn("Using a non-default timestamp_resolution {} - are you really doing inserts with USING TIMESTAMP <non_microsecond_timestamp> (or driver equivalent)?", timestampResolution.toString());
|
||||
logger.warn("Using a non-default timestamp_resolution {} - are you really doing inserts with USING TIMESTAMP <non_microsecond_timestamp> (or driver equivalent)?", timestampResolution);
|
||||
|
||||
optionValue = options.get(COMPACTION_WINDOW_UNIT_KEY);
|
||||
sstableWindowUnit = optionValue == null ? DEFAULT_COMPACTION_WINDOW_UNIT : TimeUnit.valueOf(optionValue);
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ class LogTransaction extends Transactional.AbstractTransactional implements Tran
|
|||
{
|
||||
e.printStackTrace(ps);
|
||||
}
|
||||
logger.debug("Unable to delete {} as it does not exist, stack trace:\n {}", file, baos.toString());
|
||||
logger.debug("Unable to delete {} as it does not exist, stack trace:\n {}", file, baos);
|
||||
}
|
||||
}
|
||||
catch (IOException e)
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ public class DynamicCompositeType extends AbstractCompositeType
|
|||
* If both types are ReversedType(Type), we need to compare on the wrapped type (which may differ between the two types) to avoid
|
||||
* incompatible comparisons being made.
|
||||
*/
|
||||
if ((comp1 instanceof ReversedType) && (comp2 instanceof ReversedType))
|
||||
if ((comp1 instanceof ReversedType) && (comp2 instanceof ReversedType))
|
||||
{
|
||||
comp1 = ((ReversedType<?>) comp1).baseType;
|
||||
comp2 = ((ReversedType<?>) comp2).baseType;
|
||||
|
|
@ -199,19 +199,19 @@ public class DynamicCompositeType extends AbstractCompositeType
|
|||
valueStr = ByteBufferUtil.string(value);
|
||||
comparator = TypeParser.parse(valueStr);
|
||||
}
|
||||
catch (CharacterCodingException ce)
|
||||
catch (CharacterCodingException ce)
|
||||
{
|
||||
// ByteBufferUtil.string failed.
|
||||
// ByteBufferUtil.string failed.
|
||||
// Log it here and we'll further throw an exception below since comparator == null
|
||||
logger.error("Failed with [{}] when decoding the byte buffer in ByteBufferUtil.string()",
|
||||
ce.toString());
|
||||
logger.error("Failed with [{}] when decoding the byte buffer in ByteBufferUtil.string()",
|
||||
ce);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
// parse failed.
|
||||
// parse failed.
|
||||
// Log it here and we'll further throw an exception below since comparator == null
|
||||
logger.error("Failed to parse value string \"{}\" with exception: [{}]",
|
||||
valueStr, e.toString());
|
||||
logger.error("Failed to parse value string \"{}\" with exception: [{}]",
|
||||
valueStr, e);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ class InboundHandshakeHandler extends ByteToMessageDecoder
|
|||
case HANDSHAKE_FAIL:
|
||||
throw new IllegalStateException("channel should be closed after determining the handshake failed with peer: " + ctx.channel().remoteAddress());
|
||||
default:
|
||||
logger.error("unhandled state: " + state);
|
||||
logger.error("unhandled state: {}", state);
|
||||
state = State.HANDSHAKE_FAIL;
|
||||
ctx.close();
|
||||
}
|
||||
|
|
@ -166,7 +166,7 @@ class InboundHandshakeHandler extends ByteToMessageDecoder
|
|||
// streaming connections are per-session and have a fixed version. we can't do anything with a wrong-version stream connection, so drop it.
|
||||
if (version != StreamMessage.CURRENT_VERSION)
|
||||
{
|
||||
logger.warn("Received stream using protocol version %d (my version %d). Terminating connection", version, MessagingService.current_version);
|
||||
logger.warn("Received stream using protocol version {} (my version {}). Terminating connection", version, MessagingService.current_version);
|
||||
ctx.close();
|
||||
return State.HANDSHAKE_FAIL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue