Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
*/
public abstract class AbstractColumnListMutation<C> implements ColumnListMutation<C> {
protected long timestamp;
protected Integer defaultTtl = null;
protected Integer defaultTtl;

public AbstractColumnListMutation(long timestamp) {
this.timestamp = timestamp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public NodeDiscoveryType getNodeDiscoveryType() {
}

protected <T> ConnectionPool<T> createConnectionPool(ConnectionFactory<T> connectionFactory) {
ConnectionPool<T> connectionPool = null;
ConnectionPool<T> connectionPool;

// HACK to get the CqlFamilyFactory working with AstyanaxContext
if (connectionFactory.getClass().getName().contains("CqlFamilyFactory")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ public static ComponentEquality fromByte(byte equality) {

final boolean dynamic;

List<Serializer<?>> serializersByPosition = null;
List<String> comparatorsByPosition = null;
List<Serializer<?>> serializersByPosition;
List<String> comparatorsByPosition;

public class Component<T> {
final Serializer<T> serializer;
Expand Down Expand Up @@ -190,7 +190,7 @@ public String toString() {

List<Component<?>> components = new ArrayList<Component<?>>();

ByteBuffer serialized = null;
ByteBuffer serialized;

public AbstractComposite(boolean dynamic) {
this.dynamic = dynamic;
Expand Down Expand Up @@ -680,7 +680,7 @@ public void deserialize(ByteBuffer b) {
serialized = b.duplicate();
components = new ArrayList<Component<?>>();

String comparator = null;
String comparator;
int i = 0;
while ((comparator = getComparator(i, b)) != null) {
ByteBuffer data = getWithShortLength(b);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class SerializerTypeInferer {

@SuppressWarnings({ "rawtypes", "unchecked" })
public static <T> Serializer<T> getSerializer(Object value) {
Serializer serializer = null;
Serializer serializer;
if (value == null) {
serializer = ByteBufferSerializer.get();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ private int writeColumnsAsRows(String rowKey, ColumnList<?> columns, boolean fir
columnString = e.getMessage(); // this.errorValueText;
}

String valueString = null;
String valueString;
try {
valueString = serializers.valueAsString(column.getRawName(), column.getByteBufferValue());
}
Expand Down Expand Up @@ -412,7 +412,7 @@ private void writeColumns(ColumnList<?> columns, boolean first) throws Exception
if (this.dynamicNames != null)
this.dynamicNames.add(columnString);

String valueString = null;
String valueString;
try {
valueString = serializers.valueAsString(column.getRawName(), column.getByteBufferValue());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
*
*/
public abstract class AbstractExecuteWithFailoverImpl<CL, R> implements ExecuteWithFailover<CL, R> {
protected Connection<CL> connection = null;
protected Connection<CL> connection;
private long startTime;
private long poolStartTime;
private int attemptCounter = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
public abstract class AbstractExecutionImpl<R> implements Execution<R> {
public OperationResult<R> executeWithRetry(RetryPolicy retry) throws ConnectionException {
ConnectionException lastException = null;
ConnectionException lastException;
retry.begin();
do {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ public <R> OperationResult<R> executeWithFailover(Operation<CL, R> op, RetryPoli
}

retry.begin();
ConnectionException lastException = null;
ConnectionException lastException;
do {
try {
OperationResult<R> result = newExecuteWithFailover(op).tryOperation(op);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public <R> ExecuteWithFailover<CL, R> newExecuteWithFailover(Operation<CL, R> op
roundRobinCounter.set(0);
}

AbstractExecuteWithFailoverImpl executeWithFailover = null;
AbstractExecuteWithFailoverImpl executeWithFailover;
switch (config.getHostSelectorStrategy()) {
case ROUND_ROBIN:
executeWithFailover = new RoundRobinExecuteWithFailover<CL, R>(config, monitor, pools, isSorted ? 0 : index);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public CqlAbstractExecutionImpl(KeyspaceContext ksContext, RetryPolicy retryPoli
@Override
public OperationResult<R> execute() throws ConnectionException {

ConnectionException lastException = null;
ConnectionException lastException;

retry.begin();

Expand All @@ -104,7 +104,7 @@ public OperationResult<R> execute() throws ConnectionException {


private OperationResult<R> executeOp() throws ConnectionException {
CassandraOperationTracer tracer = null;
CassandraOperationTracer tracer;

if (cf != null) {
tracer = tracerFactory.newTracer(getOperationType(), cf);
Expand Down Expand Up @@ -175,7 +175,7 @@ private RetryPolicy getRetryPolicy(RetryPolicy policy) {

private ConsistencyLevel getDefaultCL(KeyspaceContext ksContext) {

ConsistencyLevel clLevel = ksContext.getConfig().getDefaultReadConsistencyLevel();
ConsistencyLevel clLevel = ksContext.getConfig().getDefaultReadConsistencyLevel();

CassandraOperationCategory op = getOperationType().getCategory();
switch (op) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,13 @@ private void createColumnDefinitions() {

String defaultBytesType = ComparatorType.BYTESTYPE.getTypeName();

keyClass = (keyClass == null) ? keyClass = defaultBytesType : keyClass;
keyClass = (keyClass == null) ? defaultBytesType : keyClass;

String comparatorClass = (String) optionsMap.remove("comparator");
comparatorClass = (comparatorClass == null) ? comparatorClass = defaultBytesType : comparatorClass;
comparatorClass = (comparatorClass == null) ? defaultBytesType : comparatorClass;

String dataValidationClass = (String) optionsMap.remove("default_validator");
dataValidationClass = (dataValidationClass == null) ? dataValidationClass = defaultBytesType : dataValidationClass;
dataValidationClass = (dataValidationClass == null) ? defaultBytesType : dataValidationClass;

ColumnDefinition key = new CqlColumnDefinitionImpl().setName("key").setValidationClass(keyClass);
partitionKeyList.add(key);
Expand Down Expand Up @@ -311,8 +311,7 @@ private void readColDefinitions() {

Collections.sort(tmpList);
clusteringKeyList.addAll(tmpList);
tmpList = null;


List<String> allPrimaryKeyColNames = new ArrayList<String>();
for (ColumnDefinition colDef : partitionKeyList) {
allPrimaryKeyColNames.add(colDef.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class ConsistencyLevelTransform {

public static ConsistencyLevel getConsistencyLevel(com.netflix.astyanax.model.ConsistencyLevel level) {

ConsistencyLevel result = null;
ConsistencyLevel result;
switch(level) {
case CL_ONE:
result = ConsistencyLevel.ONE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ private static Object getCompositeColumn(Row row, AnnotatedCompositeSerializer<?

Class<?> clazz = compositeSerializer.getClazz();

Object obj = null;
Object obj;
try {
obj = clazz.newInstance();
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class CompositeColumnMapper extends AbstractColumnMapper {
Column annotation = childField.getAnnotation(Column.class);
if ((annotation != null)) {
childField.setAccessible(true);
ColumnMapper columnMapper = null;
ColumnMapper columnMapper;
Entity compositeAnnotation = childField.getType().getAnnotation(Entity.class);
if(compositeAnnotation == null) {
columnMapper = new LeafColumnMapper(childField);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

public class MappingUtils {
static com.netflix.astyanax.Serializer<?> getSerializerForField(Field field) {
com.netflix.astyanax.Serializer<?> serializer = null;
com.netflix.astyanax.Serializer<?> serializer;
// check if there is explicit @Serializer annotation first
Serializer serializerAnnotation = field.getAnnotation(Serializer.class);
if(serializerAnnotation != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void read(int empId) {
logger.debug("emp");
for(Iterator<Column<String>> i = cols.iterator(); i.hasNext(); ) {
Column<String> c = i.next();
Object v = null;
Object v;
if(c.getName().endsWith("id")) // type induction hack
v = c.getIntegerValue();
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ List<MessageContext> readMessagesFromShardUsingLockManager(String shardName, int
List<MessageContext> readMessagesFromShardUsingDefaultLock(String shardName, int itemsToPop) throws MessageQueueException, BusyLockException {
MutationBatch m = null;
MessageQueueEntry lockColumn = null;
ColumnListMutation<MessageQueueEntry> rowMutation = null;
ColumnListMutation<MessageQueueEntry> rowMutation;
int lockColumnCount = 0;
// Try locking first
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public void run() {

while (!terminate) {
// Process events in a tight loop, until asked to terminate
Collection<MessageContext> messages = null;
Collection<MessageContext> messages;
try {
messages = consumer.readMessages(batchSize);
if (messages.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ protected void internalRun() {
}

// Read the index shards
OperationResult<Rows<ByteBuffer, ByteBuffer>> result = null;
OperationResult<Rows<ByteBuffer, ByteBuffer>> result;
try {
result = ks.prepareQuery(cfIndex).setConsistencyLevel(consistencyLevel).withRetryPolicy(retry)
.getKeySlice(keys).withColumnRange(range.setLimit(columnLimit).build()).execute();
Expand Down Expand Up @@ -293,7 +293,7 @@ private void paginateIndexShard(final ByteBuffer shard, final V value) {
@Override
protected void internalRun() {
V nextValue = value;
ColumnList<ByteBuffer> result = null;
ColumnList<ByteBuffer> result;
List<K> batch = Lists.newArrayListWithCapacity(keyLimit);

int pageSize = shardColumnLimit;
Expand Down