You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by sl...@apache.org on 2012/02/27 11:32:02 UTC
[9/16] [3649] Strip end of line whitespaces
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/compaction/PrecompactedRow.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/PrecompactedRow.java b/src/java/org/apache/cassandra/db/compaction/PrecompactedRow.java
index 993ad06..8ea4639 100644
--- a/src/java/org/apache/cassandra/db/compaction/PrecompactedRow.java
+++ b/src/java/org/apache/cassandra/db/compaction/PrecompactedRow.java
@@ -1,6 +1,6 @@
package org.apache.cassandra.db.compaction;
/*
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -8,16 +8,16 @@ package org.apache.cassandra.db.compaction;
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*/
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/filter/AbstractColumnIterator.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/filter/AbstractColumnIterator.java b/src/java/org/apache/cassandra/db/filter/AbstractColumnIterator.java
index d4760dc..81a9ca5 100644
--- a/src/java/org/apache/cassandra/db/filter/AbstractColumnIterator.java
+++ b/src/java/org/apache/cassandra/db/filter/AbstractColumnIterator.java
@@ -1,6 +1,6 @@
package org.apache.cassandra.db.filter;
/*
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -8,16 +8,16 @@ package org.apache.cassandra.db.filter;
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*/
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/filter/ExtendedFilter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/filter/ExtendedFilter.java b/src/java/org/apache/cassandra/db/filter/ExtendedFilter.java
index e7db31a..df55c25 100644
--- a/src/java/org/apache/cassandra/db/filter/ExtendedFilter.java
+++ b/src/java/org/apache/cassandra/db/filter/ExtendedFilter.java
@@ -1,6 +1,6 @@
package org.apache.cassandra.db.filter;
/*
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -8,16 +8,16 @@ package org.apache.cassandra.db.filter;
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*/
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/filter/NamesQueryFilter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/filter/NamesQueryFilter.java b/src/java/org/apache/cassandra/db/filter/NamesQueryFilter.java
index 0b1ebc9..d6ab552 100644
--- a/src/java/org/apache/cassandra/db/filter/NamesQueryFilter.java
+++ b/src/java/org/apache/cassandra/db/filter/NamesQueryFilter.java
@@ -1,6 +1,6 @@
package org.apache.cassandra.db.filter;
/*
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -8,16 +8,16 @@ package org.apache.cassandra.db.filter;
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*/
@@ -59,7 +59,7 @@ public class NamesQueryFilter implements IFilter
{
return new SSTableNamesIterator(sstable, key, columns);
}
-
+
public IColumnIterator getSSTableColumnIterator(SSTableReader sstable, FileDataInput file, DecoratedKey<?> key)
{
return new SSTableNamesIterator(sstable, file, key, columns);
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/filter/QueryFilter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/filter/QueryFilter.java b/src/java/org/apache/cassandra/db/filter/QueryFilter.java
index eb9813f..b075f41 100644
--- a/src/java/org/apache/cassandra/db/filter/QueryFilter.java
+++ b/src/java/org/apache/cassandra/db/filter/QueryFilter.java
@@ -1,6 +1,6 @@
package org.apache.cassandra.db.filter;
/*
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -8,16 +8,16 @@ package org.apache.cassandra.db.filter;
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*/
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/filter/QueryPath.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/filter/QueryPath.java b/src/java/org/apache/cassandra/db/filter/QueryPath.java
index a6d52e6..858d506 100644
--- a/src/java/org/apache/cassandra/db/filter/QueryPath.java
+++ b/src/java/org/apache/cassandra/db/filter/QueryPath.java
@@ -1,6 +1,6 @@
package org.apache.cassandra.db.filter;
/*
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -8,16 +8,16 @@ package org.apache.cassandra.db.filter;
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*/
@@ -93,8 +93,8 @@ public class QueryPath
String cfName = din.readUTF();
ByteBuffer scName = ByteBufferUtil.readWithShortLength(din);
ByteBuffer cName = ByteBufferUtil.readWithShortLength(din);
- return new QueryPath(cfName.isEmpty() ? null : cfName,
- scName.remaining() == 0 ? null : scName,
+ return new QueryPath(cfName.isEmpty() ? null : cfName,
+ scName.remaining() == 0 ? null : scName,
cName.remaining() == 0 ? null : cName);
}
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/filter/SliceQueryFilter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/filter/SliceQueryFilter.java b/src/java/org/apache/cassandra/db/filter/SliceQueryFilter.java
index 9dc68f0..e6372c2 100644
--- a/src/java/org/apache/cassandra/db/filter/SliceQueryFilter.java
+++ b/src/java/org/apache/cassandra/db/filter/SliceQueryFilter.java
@@ -1,6 +1,6 @@
package org.apache.cassandra.db.filter;
/*
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -8,16 +8,16 @@ package org.apache.cassandra.db.filter;
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*/
@@ -64,7 +64,7 @@ public class SliceQueryFilter implements IFilter
{
return new SSTableSliceIterator(sstable, key, start, finish, reversed);
}
-
+
public IColumnIterator getSSTableColumnIterator(SSTableReader sstable, FileDataInput file, DecoratedKey<?> key)
{
return new SSTableSliceIterator(sstable, file, key, start, finish, reversed);
@@ -126,9 +126,9 @@ public class SliceQueryFilter implements IFilter
&& ((!reversed && comparator.compare(column.name(), finish) > 0))
|| (reversed && comparator.compare(column.name(), finish) < 0))
break;
-
+
// only count live columns towards the `count` criteria
- if (column.isLive()
+ if (column.isLive()
&& (!container.isMarkedForDelete()
|| column.mostRecentLiveChangeAt() > container.getMarkedForDeleteAt()))
{
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/index/PerColumnSecondaryIndex.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/index/PerColumnSecondaryIndex.java b/src/java/org/apache/cassandra/db/index/PerColumnSecondaryIndex.java
index c137ead..ba7360d 100644
--- a/src/java/org/apache/cassandra/db/index/PerColumnSecondaryIndex.java
+++ b/src/java/org/apache/cassandra/db/index/PerColumnSecondaryIndex.java
@@ -31,33 +31,33 @@ public abstract class PerColumnSecondaryIndex extends SecondaryIndex
{
/**
* Delete a column from the index
- *
+ *
* @param valueKey the column value which is used as the index key
* @param rowKey the underlying row key which is indexed
* @param col all the column info
*/
public abstract void deleteColumn(DecoratedKey<?> valueKey, ByteBuffer rowKey, IColumn col) throws IOException;
-
+
/**
* insert a column to the index
- *
+ *
* @param valueKey the column value which is used as the index key
* @param rowKey the underlying row key which is indexed
* @param col all the column info
*/
public abstract void insertColumn(DecoratedKey<?> valueKey, ByteBuffer rowKey, IColumn col) throws IOException;
-
+
/**
* update a column from the index
- *
+ *
* @param valueKey the column value which is used as the index key
* @param rowKey the underlying row key which is indexed
* @param col all the column info
*/
public abstract void updateColumn(DecoratedKey<?> valueKey, ByteBuffer rowKey, IColumn col) throws IOException;
-
+
public String getNameForSystemTable(ByteBuffer column)
{
- return getIndexName();
+ return getIndexName();
}
}
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/index/PerRowSecondaryIndex.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/index/PerRowSecondaryIndex.java b/src/java/org/apache/cassandra/db/index/PerRowSecondaryIndex.java
index f23980b..df5a41d 100644
--- a/src/java/org/apache/cassandra/db/index/PerRowSecondaryIndex.java
+++ b/src/java/org/apache/cassandra/db/index/PerRowSecondaryIndex.java
@@ -36,35 +36,35 @@ public abstract class PerRowSecondaryIndex extends SecondaryIndex
/**
* Removes obsolete index entries and creates new ones for the given row key
* and mutated columns.
- *
+ *
* @param rowKey the row key
* @param cf the current rows data
* @param mutatedIndexedColumns the set of columns that were changed or added
* @param oldIndexedColumns the columns which were deleted
- * @throws IOException
+ * @throws IOException
*/
public abstract void applyIndexUpdates(ByteBuffer rowKey,
ColumnFamily cf,
SortedSet<ByteBuffer> mutatedIndexedColumns,
ColumnFamily oldIndexedColumns) throws IOException;
-
-
+
+
/**
* cleans up deleted columns from cassandra cleanup compaction
- *
+ *
* @param key
* @param indexedColumnsInRow
*/
public abstract void deleteFromIndex(DecoratedKey<?> key, List<IColumn> indexedColumnsInRow);
-
-
+
+
@Override
public String getNameForSystemTable(ByteBuffer columnName)
{
try
{
return getIndexName()+ByteBufferUtil.string(columnName);
- }
+ }
catch (CharacterCodingException e)
{
throw new RuntimeException(e);
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/index/SecondaryIndex.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/index/SecondaryIndex.java b/src/java/org/apache/cassandra/db/index/SecondaryIndex.java
index 9571073..64a696d 100644
--- a/src/java/org/apache/cassandra/db/index/SecondaryIndex.java
+++ b/src/java/org/apache/cassandra/db/index/SecondaryIndex.java
@@ -38,32 +38,32 @@ import org.slf4j.LoggerFactory;
/**
* Abstract base class for different types of secondary indexes.
- *
+ *
* Do not extend this directly, please pick from PerColumnSecondaryIndex or PerRowSecondaryIndex
*/
public abstract class SecondaryIndex
{
-
+
private static final Logger logger = LoggerFactory.getLogger(SecondaryIndex.class);
-
+
public static final String CUSTOM_INDEX_OPTION_NAME = "class_name";
/**
* Base CF that has many indexes
*/
protected ColumnFamilyStore baseCfs;
-
-
+
+
/**
* The column definitions which this index is responsible for
*/
protected Set<ColumnDefinition> columnDefs = Collections.newSetFromMap(new ConcurrentHashMap<ColumnDefinition,Boolean>());
-
+
/**
* Perform any initialization work
*/
public abstract void init();
-
+
/**
* Validates the index_options passed in the ColumnDef
* @throws ConfigurationException
@@ -74,20 +74,20 @@ public abstract class SecondaryIndex
* @return The name of the index
*/
abstract public String getIndexName();
-
-
+
+
/**
* Return the unique name for this index and column
* to be stored in the SystemTable that tracks if each column is built
- *
+ *
* @param columnName the name of the column
* @return the unique name
*/
abstract public String getNameForSystemTable(ByteBuffer columnName);
-
+
/**
* Checks if the index for specified column is fully built
- *
+ *
* @param columnName the column
* @return true if the index is fully built
*/
@@ -95,7 +95,7 @@ public abstract class SecondaryIndex
{
return SystemTable.isIndexBuilt(baseCfs.table.name, getNameForSystemTable(columnName));
}
-
+
public void setIndexBuilt(ByteBuffer columnName)
{
SystemTable.setIndexBuilt(baseCfs.table.name, getNameForSystemTable(columnName));
@@ -105,7 +105,7 @@ public abstract class SecondaryIndex
{
SystemTable.setIndexRemoved(baseCfs.table.name, getNameForSystemTable(columnName));
}
-
+
/**
* Called at query time
* Creates a implementation specific searcher instance for this index type
@@ -113,7 +113,7 @@ public abstract class SecondaryIndex
* @return the secondary index search impl
*/
protected abstract SecondaryIndexSearcher createSecondaryIndexSearcher(Set<ByteBuffer> columns);
-
+
/**
* Forces this indexes in memory data to disk
* @throws IOException
@@ -124,14 +124,14 @@ public abstract class SecondaryIndex
* Get current amount of memory this index is consuming (in bytes)
*/
public abstract long getLiveSize();
-
+
/**
* Allow access to the underlying column family store if there is one
* @return the underlying column family store or null
*/
public abstract ColumnFamilyStore getIndexCfs();
-
-
+
+
/**
* Delete all files and references to this index
* @param columnName the indexed column to remove
@@ -149,7 +149,7 @@ public abstract class SecondaryIndex
* @param truncatedAt The truncation timestamp, all data before that timestamp should be rejected.
*/
public abstract void truncate(long truncatedAt);
-
+
/**
* Builds the index using the data in the underlying CFS
* Blocks till it's complete
@@ -160,7 +160,7 @@ public abstract class SecondaryIndex
getIndexName(), StringUtils.join(baseCfs.getSSTables(), ", ")));
SortedSet<ByteBuffer> columnNames = new TreeSet<ByteBuffer>();
-
+
for (ColumnDefinition cdef : columnDefs)
columnNames.add(cdef.name);
@@ -173,7 +173,7 @@ public abstract class SecondaryIndex
{
future.get();
forceBlockingFlush();
-
+
// Mark all indexed columns as built
if (this instanceof PerRowSecondaryIndex)
{
@@ -200,11 +200,11 @@ public abstract class SecondaryIndex
logger.info("Index build of " + getIndexName() + " complete");
}
-
+
/**
* Builds the index using the data in the underlying CF, non blocking
- *
- *
+ *
+ *
* @return A future object which the caller can block on (optional)
*/
public Future<?> buildIndexAsync()
@@ -219,10 +219,10 @@ public abstract class SecondaryIndex
break;
}
}
-
+
if (allAreBuilt)
return null;
-
+
// build it asynchronously; addIndex gets called by CFS open and schema update, neither of which
// we want to block for a long period. (actual build is serialized on CompactionManager.)
Runnable runnable = new Runnable()
@@ -241,11 +241,11 @@ public abstract class SecondaryIndex
{
throw new AssertionError(e);
}
-
+
try
{
buildIndexBlocking();
- }
+ }
catch (IOException e)
{
throw new RuntimeException(e);
@@ -253,11 +253,11 @@ public abstract class SecondaryIndex
}
};
FutureTask<?> f = new FutureTask<Object>(runnable, null);
-
+
new Thread(f, "Creating index: " + getIndexName()).start();
return f;
}
-
+
public ColumnFamilyStore getBaseCfs()
{
return baseCfs;
@@ -277,7 +277,7 @@ public abstract class SecondaryIndex
{
columnDefs.add(columnDef);
}
-
+
void removeColumnDef(ByteBuffer name)
{
Iterator<ColumnDefinition> it = columnDefs.iterator();
@@ -287,11 +287,11 @@ public abstract class SecondaryIndex
it.remove();
}
}
-
+
/**
* This is the primary way to create a secondary index instance for a CF column.
* It will validate the index_options before initializing.
- *
+ *
* @param baseCfs the source of data for the Index
* @param cdef the meta information about this column (index_type, index_options, name, etc...)
*
@@ -301,33 +301,33 @@ public abstract class SecondaryIndex
public static SecondaryIndex createInstance(ColumnFamilyStore baseCfs, ColumnDefinition cdef) throws ConfigurationException
{
SecondaryIndex index;
-
+
switch (cdef.getIndexType())
{
- case KEYS:
+ case KEYS:
index = new KeysIndex();
break;
- case CUSTOM:
+ case CUSTOM:
assert cdef.getIndexOptions() != null;
String class_name = cdef.getIndexOptions().get(CUSTOM_INDEX_OPTION_NAME);
assert class_name != null;
try
{
index = (SecondaryIndex) Class.forName(class_name).newInstance();
- }
+ }
catch (Exception e)
{
throw new RuntimeException(e);
- }
+ }
break;
default:
throw new RuntimeException("Unknown index type: " + cdef.getIndexName());
}
-
+
index.addColumnDef(cdef);
index.validateOptions();
index.setBaseCfs(baseCfs);
-
+
return index;
}
}
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/index/SecondaryIndexBuilder.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/index/SecondaryIndexBuilder.java b/src/java/org/apache/cassandra/db/index/SecondaryIndexBuilder.java
index 10cd452..037245e 100644
--- a/src/java/org/apache/cassandra/db/index/SecondaryIndexBuilder.java
+++ b/src/java/org/apache/cassandra/db/index/SecondaryIndexBuilder.java
@@ -37,7 +37,7 @@ public class SecondaryIndexBuilder extends CompactionInfo.Holder
private final ColumnFamilyStore cfs;
private final SortedSet<ByteBuffer> columns;
private final ReducingKeyIterator iter;
-
+
public SecondaryIndexBuilder(ColumnFamilyStore cfs, SortedSet<ByteBuffer> columns, ReducingKeyIterator iter)
{
this.cfs = cfs;
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java b/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java
index aa16db2..2d99d1c 100644
--- a/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java
+++ b/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java
@@ -49,16 +49,16 @@ public class SecondaryIndexManager
* Organizes the indexes by column name
*/
private final ConcurrentNavigableMap<ByteBuffer, SecondaryIndex> indexesByColumn;
-
-
+
+
/**
* Keeps a single instance of a SecondaryIndex for many columns when the index type
* has isRowLevelIndex() == true
- *
+ *
* This allows updates to happen to an entire row at once
*/
private final Map<Class<? extends SecondaryIndex>,SecondaryIndex> rowLevelIndexMap;
-
+
/**
* The underlying column family containing the source data for these indexes
@@ -69,13 +69,13 @@ public class SecondaryIndexManager
{
indexesByColumn = new ConcurrentSkipListMap<ByteBuffer, SecondaryIndex>();
rowLevelIndexMap = new HashMap<Class<? extends SecondaryIndex>, SecondaryIndex>();
-
+
this.baseCfs = baseCfs;
}
/**
* Drops and adds new indexes associated with the underlying CF
- * @throws IOException
+ * @throws IOException
*/
public void reload() throws IOException
{
@@ -100,8 +100,8 @@ public class SecondaryIndexManager
cfs.reload();
}
}
-
-
+
+
/**
* Does a full, blocking rebuild of the indexes specified by columns from the sstables.
* Does nothing if columns is empty.
@@ -110,7 +110,7 @@ public class SecondaryIndexManager
*
* @param sstables the data to build from
* @param columns the list of columns to index, ordered by comparator
- * @throws IOException
+ * @throws IOException
*/
public void maybeBuildSecondaryIndexes(Collection<SSTableReader> sstables, SortedSet<ByteBuffer> columns) throws IOException
{
@@ -170,15 +170,15 @@ public class SecondaryIndexManager
/**
* Removes a existing index
* @param column the indexed column to remove
- * @throws IOException
+ * @throws IOException
*/
public void removeIndexedColumn(ByteBuffer column) throws IOException
{
SecondaryIndex index = indexesByColumn.remove(column);
-
+
if (index == null)
return;
-
+
// Remove this column from from row level index map
if (index instanceof PerRowSecondaryIndex)
{
@@ -200,13 +200,13 @@ public class SecondaryIndexManager
*/
public synchronized Future<?> addIndexedColumn(ColumnDefinition cdef)
{
-
+
if (indexesByColumn.containsKey(cdef.name))
return null;
-
+
assert cdef.getIndexType() != null;
logger.info("Creating new index : {}",cdef);
-
+
SecondaryIndex index;
try
{
@@ -214,14 +214,14 @@ public class SecondaryIndexManager
} catch (ConfigurationException e)
{
throw new RuntimeException(e);
- }
-
+ }
+
// Keep a single instance of the index per-cf for row level indexes
// since we want all columns to be under the index
if (index instanceof PerRowSecondaryIndex)
{
SecondaryIndex currentIndex = rowLevelIndexMap.get(index.getClass());
-
+
if (currentIndex == null)
{
rowLevelIndexMap.put(index.getClass(), index);
@@ -231,20 +231,20 @@ public class SecondaryIndexManager
{
index = currentIndex;
index.addColumnDef(cdef);
- }
+ }
}
else
{
index.init();
}
-
+
// link in indexedColumns. this means that writes will add new data to
// the index immediately,
// so we don't have to lock everything while we do the build. it's up to
// the operator to wait
// until the index is actually built before using in queries.
indexesByColumn.put(cdef.name, index);
-
+
// if we're just linking in the index to indexedColumns on an
// already-built index post-restart, we're done
if (index.isIndexBuilt(cdef.name))
@@ -254,7 +254,7 @@ public class SecondaryIndexManager
}
/**
- *
+ *
* @param column the name of indexes column
* @return the index
*/
@@ -282,7 +282,7 @@ public class SecondaryIndexManager
for (Map.Entry<ByteBuffer, SecondaryIndex> entry : indexesByColumn.entrySet())
entry.getValue().forceBlockingFlush();
}
-
+
/**
* Returns the decoratedKey for a column value
* @param name column name
@@ -293,38 +293,38 @@ public class SecondaryIndexManager
{
return new DecoratedKey<LocalToken>(new LocalToken(baseCfs.metadata.getColumnDefinition(name).getValidator(), value), value);
}
-
-
+
+
/**
* @return all built indexes (ready to use)
*/
public List<String> getBuiltIndexes()
{
List<String> indexList = new ArrayList<String>();
-
+
for (Map.Entry<ByteBuffer, SecondaryIndex> entry : indexesByColumn.entrySet())
{
SecondaryIndex index = entry.getValue();
-
- if (index.isIndexBuilt(entry.getKey()))
+
+ if (index.isIndexBuilt(entry.getKey()))
{
indexList.add(entry.getValue().getIndexName());
}
}
-
+
return indexList;
}
-
+
public ByteBuffer getColumnByIdxName(String idxName)
- {
+ {
for (Map.Entry<ByteBuffer, SecondaryIndex> entry : indexesByColumn.entrySet())
{
- if (entry.getValue().getIndexName().equals(idxName))
+ if (entry.getValue().getIndexName().equals(idxName))
return entry.getKey();
}
throw new RuntimeException("Unknown Index Name: " + idxName);
}
-
+
/**
* @return all CFS from indexes which use a backing CFS internally (KEYS)
*/
@@ -335,14 +335,14 @@ public class SecondaryIndexManager
for (Map.Entry<ByteBuffer, SecondaryIndex> entry : indexesByColumn.entrySet())
{
ColumnFamilyStore cfs = entry.getValue().getIndexCfs();
-
+
if (cfs != null)
- cfsList.add(cfs);
+ cfsList.add(cfs);
}
-
+
return cfsList;
}
-
+
/**
* @return all indexes which do *not* use a backing CFS internally
*/
@@ -355,11 +355,11 @@ public class SecondaryIndexManager
for (Map.Entry<ByteBuffer, SecondaryIndex> entry : indexesByColumn.entrySet())
{
ColumnFamilyStore cfs = entry.getValue().getIndexCfs();
-
+
if (cfs == null)
- indexList.put(entry.getValue(), null);
+ indexList.put(entry.getValue(), null);
}
-
+
return indexList.keySet();
}
@@ -383,7 +383,7 @@ public class SecondaryIndexManager
public long getTotalLiveSize()
{
long total = 0;
-
+
// we use identity map because per row indexes use same instance
// across many columns
IdentityHashMap<SecondaryIndex, Object> indexList = new IdentityHashMap<SecondaryIndex, Object>();
@@ -391,65 +391,65 @@ public class SecondaryIndexManager
for (Map.Entry<ByteBuffer, SecondaryIndex> entry : indexesByColumn.entrySet())
{
SecondaryIndex index = entry.getValue();
-
+
if (indexList.put(index, index) == null)
total += index.getLiveSize();
}
-
+
return total;
}
-
+
/**
* Removes obsolete index entries and creates new ones for the given row key
* and mutated columns.
- *
+ *
* For columns whos underlying index type has the isRowLevelIndex() flag set to true this function will
- * call the
- *
+ * call the
+ *
* @param rowKey the row key
* @param cf the current rows data
* @param mutatedIndexedColumns the set of columns that were changed or added
* @param oldIndexedColumns the columns what were deleted
- * @throws IOException
+ * @throws IOException
*/
public void applyIndexUpdates(ByteBuffer rowKey,
ColumnFamily cf,
SortedSet<ByteBuffer> mutatedIndexedColumns,
ColumnFamily oldIndexedColumns) throws IOException
{
-
+
// Identify the columns with PerRowSecondaryIndexes
// we need to make sure this is only called once
- Set<Class<? extends SecondaryIndex>> appliedRowLevelIndexes = null;
-
+ Set<Class<? extends SecondaryIndex>> appliedRowLevelIndexes = null;
+
// remove the old index entries
if (oldIndexedColumns != null)
{
for (ByteBuffer columnName : oldIndexedColumns.getColumnNames())
{
-
+
IColumn column = oldIndexedColumns.getColumn(columnName);
-
+
if (column == null)
continue;
-
+
//this was previously deleted so should not be in index
if (column.isMarkedForDelete())
- continue;
-
+ continue;
+
SecondaryIndex index = getIndexForColumn(columnName);
if (index == null)
{
logger.debug("Looks like index got dropped mid-update. Skipping");
continue;
}
-
+
// Update entire row if we encounter a row level index
if (index instanceof PerRowSecondaryIndex)
{
if (appliedRowLevelIndexes == null)
appliedRowLevelIndexes = new HashSet<Class<? extends SecondaryIndex>>();
-
+
if (appliedRowLevelIndexes.add(index.getClass()))
((PerRowSecondaryIndex)index).applyIndexUpdates(rowKey, cf, mutatedIndexedColumns, oldIndexedColumns);
}
@@ -461,7 +461,7 @@ public class SecondaryIndexManager
}
}
}
-
+
//insert new columns
for (ByteBuffer columnName : mutatedIndexedColumns)
{
@@ -481,19 +481,19 @@ public class SecondaryIndexManager
{
if (appliedRowLevelIndexes == null)
appliedRowLevelIndexes = new HashSet<Class<? extends SecondaryIndex>>();
-
+
if (appliedRowLevelIndexes.add(index.getClass()))
((PerRowSecondaryIndex)index).applyIndexUpdates(rowKey, cf, mutatedIndexedColumns, oldIndexedColumns);
}
else
{
DecoratedKey<LocalToken> valueKey = getIndexKeyFor(columnName, column.value());
-
- ((PerColumnSecondaryIndex)index).insertColumn(valueKey, rowKey, column);
+
+ ((PerColumnSecondaryIndex)index).insertColumn(valueKey, rowKey, column);
}
}
}
-
+
/**
* Delete all columns from all indexes for this row
* @param key the row key
@@ -501,36 +501,36 @@ public class SecondaryIndexManager
*/
public void deleteFromIndexes(DecoratedKey<?> key, List<IColumn> indexedColumnsInRow) throws IOException
{
-
- // Identify the columns with isRowLevelIndex == true
+
+ // Identify the columns with isRowLevelIndex == true
// we need to make sure this is only called once
- Set<Class<? extends SecondaryIndex>> cleanedRowLevelIndexes = null;
-
+ Set<Class<? extends SecondaryIndex>> cleanedRowLevelIndexes = null;
+
for (IColumn column : indexedColumnsInRow)
{
SecondaryIndex index = indexesByColumn.get(column.name());
-
+
if (index == null)
continue;
-
+
//Update entire row if we encounter a row level index
if (index instanceof PerRowSecondaryIndex)
{
if (cleanedRowLevelIndexes == null)
cleanedRowLevelIndexes = new HashSet<Class<? extends SecondaryIndex>>();
-
+
if (cleanedRowLevelIndexes.add(index.getClass()))
- ((PerRowSecondaryIndex)index).deleteFromIndex(key, indexedColumnsInRow);
+ ((PerRowSecondaryIndex)index).deleteFromIndex(key, indexedColumnsInRow);
}
else
{
DecoratedKey<LocalToken> valueKey = getIndexKeyFor(column.name(), column.value());
((PerColumnSecondaryIndex) index).deleteColumn(valueKey, key.key, column);
}
- }
+ }
}
-
-
+
+
/**
* Get a list of IndexSearchers from the union of expression index types
* @param clause the query clause
@@ -539,42 +539,42 @@ public class SecondaryIndexManager
private List<SecondaryIndexSearcher> getIndexSearchersForQuery(List<IndexExpression> clause)
{
List<SecondaryIndexSearcher> indexSearchers = new ArrayList<SecondaryIndexSearcher>();
-
+
Map<String, Set<ByteBuffer>> groupByIndexType = new HashMap<String, Set<ByteBuffer>>();
-
-
+
+
//Group columns by type
for (IndexExpression ix : clause)
{
SecondaryIndex index = getIndexForColumn(ix.column_name);
-
+
if (index == null)
continue;
-
+
Set<ByteBuffer> columns = groupByIndexType.get(index.getClass().getCanonicalName());
-
+
if (columns == null)
{
columns = new HashSet<ByteBuffer>();
groupByIndexType.put(index.getClass().getCanonicalName(), columns);
}
-
- columns.add(ix.column_name);
+
+ columns.add(ix.column_name);
}
-
+
//create searcher per type
for (Map.Entry<String, Set<ByteBuffer>> entry : groupByIndexType.entrySet())
{
indexSearchers.add( getIndexForColumn(entry.getValue().iterator().next()).createSecondaryIndexSearcher(entry.getValue()) );
}
-
+
return indexSearchers;
}
-
+
/**
* Performs a search across a number of column indexes
* TODO: add support for querying across index types
- *
+ *
* @param clause the index query clause
* @param range the row range to restrict to
* @param dataFilter the column range to restrict to
@@ -583,15 +583,15 @@ public class SecondaryIndexManager
public List<Row> search(List<IndexExpression> clause, AbstractBounds<RowPosition> range, int maxResults, IFilter dataFilter, boolean maxIsColumns)
{
List<SecondaryIndexSearcher> indexSearchers = getIndexSearchersForQuery(clause);
-
+
if (indexSearchers.isEmpty())
return Collections.emptyList();
-
+
//We currently don't support searching across multiple index types
if (indexSearchers.size() > 1)
throw new RuntimeException("Unable to search across multiple secondary index types");
-
-
+
+
return indexSearchers.get(0).search(clause, range, maxResults, dataFilter, maxIsColumns);
}
@@ -600,7 +600,7 @@ public class SecondaryIndexManager
for (ByteBuffer colName : indexes)
indexesByColumn.get(colName).setIndexBuilt(colName);
}
-
+
public void setIndexRemoved(Collection<ByteBuffer> indexes)
{
for (ByteBuffer colName : indexes)
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/index/SecondaryIndexSearcher.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/index/SecondaryIndexSearcher.java b/src/java/org/apache/cassandra/db/index/SecondaryIndexSearcher.java
index a74b0de..cce1afe 100644
--- a/src/java/org/apache/cassandra/db/index/SecondaryIndexSearcher.java
+++ b/src/java/org/apache/cassandra/db/index/SecondaryIndexSearcher.java
@@ -32,7 +32,7 @@ public abstract class SecondaryIndexSearcher
protected SecondaryIndexManager indexManager;
protected Set<ByteBuffer> columns;
protected ColumnFamilyStore baseCfs;
-
+
public SecondaryIndexSearcher(SecondaryIndexManager indexManager, Set<ByteBuffer> columns)
{
this.indexManager = indexManager;
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/index/keys/KeysIndex.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/index/keys/KeysIndex.java b/src/java/org/apache/cassandra/db/index/keys/KeysIndex.java
index 7b22a48..fa663ca 100644
--- a/src/java/org/apache/cassandra/db/index/keys/KeysIndex.java
+++ b/src/java/org/apache/cassandra/db/index/keys/KeysIndex.java
@@ -47,10 +47,10 @@ public class KeysIndex extends PerColumnSecondaryIndex
private static final Logger logger = LoggerFactory.getLogger(KeysIndex.class);
private ColumnFamilyStore indexCfs;
- public KeysIndex()
+ public KeysIndex()
{
}
-
+
public void init()
{
assert baseCfs != null && columnDefs != null;
@@ -75,7 +75,7 @@ public class KeysIndex extends PerColumnSecondaryIndex
{
if (column.isMarkedForDelete())
return;
-
+
int localDeletionTime = (int) (System.currentTimeMillis() / 1000);
ColumnFamily cfi = ColumnFamily.create(indexCfs.metadata);
cfi.addTombstone(rowKey, localDeletionTime, column.timestamp());
@@ -98,30 +98,30 @@ public class KeysIndex extends PerColumnSecondaryIndex
}
if (logger.isDebugEnabled())
logger.debug("applying index row {} in {}", indexCfs.metadata.getKeyValidator().getString(valueKey.key), cfi);
-
+
indexCfs.apply(valueKey, cfi);
}
-
+
public void updateColumn(DecoratedKey<?> valueKey, ByteBuffer rowKey, IColumn col)
- {
- insertColumn(valueKey, rowKey, col);
+ {
+ insertColumn(valueKey, rowKey, col);
}
public void removeIndex(ByteBuffer columnName) throws IOException
- {
+ {
indexCfs.invalidate();
}
public void forceBlockingFlush() throws IOException
- {
+ {
try
{
indexCfs.forceBlockingFlush();
- }
+ }
catch (ExecutionException e)
{
throw new IOException(e);
- }
+ }
catch (InterruptedException e)
{
throw new IOException(e);
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/index/keys/KeysSearcher.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/index/keys/KeysSearcher.java b/src/java/org/apache/cassandra/db/index/keys/KeysSearcher.java
index 124169a..bd4be7e 100644
--- a/src/java/org/apache/cassandra/db/index/keys/KeysSearcher.java
+++ b/src/java/org/apache/cassandra/db/index/keys/KeysSearcher.java
@@ -37,12 +37,12 @@ import org.slf4j.LoggerFactory;
public class KeysSearcher extends SecondaryIndexSearcher
{
private static final Logger logger = LoggerFactory.getLogger(KeysSearcher.class);
-
+
public KeysSearcher(SecondaryIndexManager indexManager, Set<ByteBuffer> columns)
{
super(indexManager, columns);
}
-
+
private IndexExpression highestSelectivityPredicate(List<IndexExpression> clause)
{
IndexExpression best = null;
@@ -52,7 +52,7 @@ public class KeysSearcher extends SecondaryIndexSearcher
//skip columns belonging to a different index type
if(!columns.contains(expression.column_name))
continue;
-
+
SecondaryIndex index = indexManager.getIndexForColumn(expression.column_name);
if (index == null || (expression.op != IndexOperator.EQ))
continue;
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/marshal/AbstractCommutativeType.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/marshal/AbstractCommutativeType.java b/src/java/org/apache/cassandra/db/marshal/AbstractCommutativeType.java
index 8e4c304..358f4eb 100644
--- a/src/java/org/apache/cassandra/db/marshal/AbstractCommutativeType.java
+++ b/src/java/org/apache/cassandra/db/marshal/AbstractCommutativeType.java
@@ -1,5 +1,5 @@
/*
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,16 +7,16 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*/
package org.apache.cassandra.db.marshal;
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/marshal/AbstractType.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/marshal/AbstractType.java b/src/java/org/apache/cassandra/db/marshal/AbstractType.java
index 750d883..cab8d7f 100644
--- a/src/java/org/apache/cassandra/db/marshal/AbstractType.java
+++ b/src/java/org/apache/cassandra/db/marshal/AbstractType.java
@@ -1,6 +1,6 @@
package org.apache.cassandra.db.marshal;
/*
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -8,16 +8,16 @@ package org.apache.cassandra.db.marshal;
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*/
@@ -93,9 +93,9 @@ public abstract class AbstractType<T> implements Comparator<ByteBuffer>
}
};
}
-
+
public abstract T compose(ByteBuffer bytes);
-
+
public abstract ByteBuffer decompose(T value);
/** get a string representation of the bytes suitable for log messages */
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/marshal/AsciiType.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/marshal/AsciiType.java b/src/java/org/apache/cassandra/db/marshal/AsciiType.java
index 9522f09..341af1c 100644
--- a/src/java/org/apache/cassandra/db/marshal/AsciiType.java
+++ b/src/java/org/apache/cassandra/db/marshal/AsciiType.java
@@ -1,6 +1,6 @@
package org.apache.cassandra.db.marshal;
/*
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -8,16 +8,16 @@ package org.apache.cassandra.db.marshal;
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*/
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/marshal/BooleanType.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/marshal/BooleanType.java b/src/java/org/apache/cassandra/db/marshal/BooleanType.java
index 00af80a..7621519 100644
--- a/src/java/org/apache/cassandra/db/marshal/BooleanType.java
+++ b/src/java/org/apache/cassandra/db/marshal/BooleanType.java
@@ -1,6 +1,6 @@
package org.apache.cassandra.db.marshal;
/*
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -8,16 +8,16 @@ package org.apache.cassandra.db.marshal;
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*/
import java.nio.ByteBuffer;
@@ -39,7 +39,7 @@ public class BooleanType extends AbstractType<Boolean>
{
return JdbcBoolean.instance.decompose(value);
}
-
+
public int compare(ByteBuffer o1, ByteBuffer o2)
{
if ((o1 == null) || (o1.remaining() != 1))
@@ -64,15 +64,15 @@ public class BooleanType extends AbstractType<Boolean>
public ByteBuffer fromString(String source) throws MarshalException
{
-
+
if (source.isEmpty()|| source.equalsIgnoreCase(Boolean.FALSE.toString()))
return decompose(false);
-
+
if (source.equalsIgnoreCase(Boolean.TRUE.toString()))
return decompose(true);
-
+
throw new MarshalException(String.format("unable to make boolean from '%s'", source));
-
+
}
public void validate(ByteBuffer bytes) throws MarshalException
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/marshal/BytesType.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/marshal/BytesType.java b/src/java/org/apache/cassandra/db/marshal/BytesType.java
index 3c7257f..1ac56c5 100644
--- a/src/java/org/apache/cassandra/db/marshal/BytesType.java
+++ b/src/java/org/apache/cassandra/db/marshal/BytesType.java
@@ -1,6 +1,6 @@
package org.apache.cassandra.db.marshal;
/*
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -8,16 +8,16 @@ package org.apache.cassandra.db.marshal;
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*/
@@ -42,7 +42,7 @@ public class BytesType extends AbstractType<ByteBuffer>
{
return JdbcBytes.instance.decompose(value);
}
-
+
public int compare(ByteBuffer o1, ByteBuffer o2)
{
return BytesType.bytesCompare(o1, o2);
@@ -54,7 +54,7 @@ public class BytesType extends AbstractType<ByteBuffer>
if(null == o2) return 0;
else return -1;
}
-
+
return ByteBufferUtil.compareUnsigned(o1, o2);
}
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/marshal/CounterColumnType.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/marshal/CounterColumnType.java b/src/java/org/apache/cassandra/db/marshal/CounterColumnType.java
index 6dbd2cb..713e608 100644
--- a/src/java/org/apache/cassandra/db/marshal/CounterColumnType.java
+++ b/src/java/org/apache/cassandra/db/marshal/CounterColumnType.java
@@ -1,5 +1,5 @@
/*
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,16 +7,16 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*/
package org.apache.cassandra.db.marshal;
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/marshal/DateType.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/marshal/DateType.java b/src/java/org/apache/cassandra/db/marshal/DateType.java
index a8dbcef..9994876 100644
--- a/src/java/org/apache/cassandra/db/marshal/DateType.java
+++ b/src/java/org/apache/cassandra/db/marshal/DateType.java
@@ -1,6 +1,6 @@
package org.apache.cassandra.db.marshal;
/*
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -8,16 +8,16 @@ package org.apache.cassandra.db.marshal;
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*/
import static org.apache.cassandra.cql.jdbc.JdbcDate.iso8601Patterns;
@@ -35,7 +35,7 @@ public class DateType extends AbstractType<Date>
public static final DateType instance = new DateType();
static final String DEFAULT_FORMAT = iso8601Patterns[3];
-
+
static final SimpleDateFormat FORMATTER = new SimpleDateFormat(DEFAULT_FORMAT);
DateType() {} // singleton
@@ -44,12 +44,12 @@ public class DateType extends AbstractType<Date>
{
return JdbcDate.instance.compose(bytes);
}
-
+
public ByteBuffer decompose(Date value)
{
return JdbcDate.instance.decompose(value);
}
-
+
public int compare(ByteBuffer o1, ByteBuffer o2)
{
if (o1.remaining() == 0)
@@ -81,10 +81,10 @@ public class DateType extends AbstractType<Date>
// Return an empty ByteBuffer for an empty string.
if (source.isEmpty())
return ByteBufferUtil.EMPTY_BYTE_BUFFER;
-
+
long millis;
ByteBuffer idBytes = null;
-
+
if (source.toLowerCase().equals("now"))
{
millis = System.currentTimeMillis();
@@ -115,7 +115,7 @@ public class DateType extends AbstractType<Date>
throw new MarshalException(String.format("unable to coerce '%s' to a formatted date (long)", source), e1);
}
}
-
+
return idBytes;
}
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/marshal/DecimalType.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/marshal/DecimalType.java b/src/java/org/apache/cassandra/db/marshal/DecimalType.java
index 1c44b97..25ce95e 100644
--- a/src/java/org/apache/cassandra/db/marshal/DecimalType.java
+++ b/src/java/org/apache/cassandra/db/marshal/DecimalType.java
@@ -1,6 +1,6 @@
package org.apache.cassandra.db.marshal;
/*
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -8,16 +8,16 @@ package org.apache.cassandra.db.marshal;
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*/
import java.math.BigDecimal;
@@ -30,7 +30,7 @@ public class DecimalType extends AbstractType<BigDecimal>
{
public static final DecimalType instance = new DecimalType();
- DecimalType() {} // singleton
+ DecimalType() {} // singleton
public int compare(ByteBuffer bb0, ByteBuffer bb1)
{
@@ -42,7 +42,7 @@ public class DecimalType extends AbstractType<BigDecimal>
{
return 1;
}
-
+
return compose(bb0).compareTo(compose(bb1));
}
@@ -69,7 +69,7 @@ public class DecimalType extends AbstractType<BigDecimal>
{
// Return an empty ByteBuffer for an empty string.
if (source.isEmpty()) return ByteBufferUtil.EMPTY_BYTE_BUFFER;
-
+
BigDecimal decimal;
try
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/marshal/DoubleType.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/marshal/DoubleType.java b/src/java/org/apache/cassandra/db/marshal/DoubleType.java
index 44d086b..8a684de 100644
--- a/src/java/org/apache/cassandra/db/marshal/DoubleType.java
+++ b/src/java/org/apache/cassandra/db/marshal/DoubleType.java
@@ -1,6 +1,6 @@
package org.apache.cassandra.db.marshal;
/*
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -8,16 +8,16 @@ package org.apache.cassandra.db.marshal;
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*/
import java.nio.ByteBuffer;
@@ -29,17 +29,17 @@ public class DoubleType extends AbstractType<Double>
{
public static final DoubleType instance = new DoubleType();
- DoubleType() {} // singleton
+ DoubleType() {} // singleton
public Double compose(ByteBuffer bytes)
{
return JdbcDouble.instance.compose(bytes);
}
-
+
public ByteBuffer decompose(Double value)
{
return JdbcDouble.instance.decompose(value);
- }
+ }
public int compare(ByteBuffer o1, ByteBuffer o2)
{
@@ -51,12 +51,12 @@ public class DoubleType extends AbstractType<Double>
{
return 1;
}
-
+
return compose(o1).compareTo(compose(o2));
}
public String getString(ByteBuffer bytes)
- {
+ {
try
{
return JdbcDouble.instance.getString(bytes);
@@ -72,7 +72,7 @@ public class DoubleType extends AbstractType<Double>
// Return an empty ByteBuffer for an empty string.
if (source.isEmpty())
return ByteBufferUtil.EMPTY_BYTE_BUFFER;
-
+
Double d;
try
{
@@ -82,7 +82,7 @@ public class DoubleType extends AbstractType<Double>
{
throw new MarshalException(String.format("unable to coerce '%s' to a double", source), e1);
}
-
+
return decompose(d);
}
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/marshal/FloatType.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/marshal/FloatType.java b/src/java/org/apache/cassandra/db/marshal/FloatType.java
index b946407..6378a9d 100644
--- a/src/java/org/apache/cassandra/db/marshal/FloatType.java
+++ b/src/java/org/apache/cassandra/db/marshal/FloatType.java
@@ -1,6 +1,6 @@
package org.apache.cassandra.db.marshal;
/*
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -8,16 +8,16 @@ package org.apache.cassandra.db.marshal;
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*/
import java.nio.ByteBuffer;
@@ -30,17 +30,17 @@ public class FloatType extends AbstractType<Float>
{
public static final FloatType instance = new FloatType();
- FloatType() {} // singleton
+ FloatType() {} // singleton
public Float compose(ByteBuffer bytes)
{
return JdbcFloat.instance.compose(bytes);
}
-
+
public ByteBuffer decompose(Float value)
{
return JdbcFloat.instance.decompose(value);
- }
+ }
public int compare(ByteBuffer o1, ByteBuffer o2)
{
@@ -52,7 +52,7 @@ public class FloatType extends AbstractType<Float>
{
return 1;
}
-
+
return compose(o1).compareTo(compose(o2));
}
@@ -73,7 +73,7 @@ public class FloatType extends AbstractType<Float>
// Return an empty ByteBuffer for an empty string.
if (source.isEmpty())
return ByteBufferUtil.EMPTY_BYTE_BUFFER;
-
+
try
{
float f = Float.parseFloat(source);
@@ -82,7 +82,7 @@ public class FloatType extends AbstractType<Float>
catch (NumberFormatException e1)
{
throw new MarshalException(String.format("unable to coerce '%s' to a float", source), e1);
- }
+ }
}
public void validate(ByteBuffer bytes) throws MarshalException
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/marshal/Int32Type.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/marshal/Int32Type.java b/src/java/org/apache/cassandra/db/marshal/Int32Type.java
index c377496..ff0abb2 100644
--- a/src/java/org/apache/cassandra/db/marshal/Int32Type.java
+++ b/src/java/org/apache/cassandra/db/marshal/Int32Type.java
@@ -1,6 +1,6 @@
package org.apache.cassandra.db.marshal;
/*
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -8,16 +8,16 @@ package org.apache.cassandra.db.marshal;
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*/
@@ -56,8 +56,8 @@ public class Int32Type extends AbstractType<Integer>
int diff = o1.get(o1.position()) - o2.get(o2.position());
if (diff != 0)
return diff;
-
-
+
+
return ByteBufferUtil.compareUnsigned(o1, o2);
}
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/marshal/IntegerType.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/marshal/IntegerType.java b/src/java/org/apache/cassandra/db/marshal/IntegerType.java
index 9f303b2..f92de38 100644
--- a/src/java/org/apache/cassandra/db/marshal/IntegerType.java
+++ b/src/java/org/apache/cassandra/db/marshal/IntegerType.java
@@ -135,7 +135,7 @@ public final class IntegerType extends AbstractType<BigInteger>
// Return an empty ByteBuffer for an empty string.
if (source.isEmpty())
return ByteBufferUtil.EMPTY_BYTE_BUFFER;
-
+
BigInteger integerType;
try
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/marshal/LexicalUUIDType.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/marshal/LexicalUUIDType.java b/src/java/org/apache/cassandra/db/marshal/LexicalUUIDType.java
index 664752c..40486e4 100644
--- a/src/java/org/apache/cassandra/db/marshal/LexicalUUIDType.java
+++ b/src/java/org/apache/cassandra/db/marshal/LexicalUUIDType.java
@@ -1,6 +1,6 @@
package org.apache.cassandra.db.marshal;
/*
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -8,16 +8,16 @@ package org.apache.cassandra.db.marshal;
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*/
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/marshal/LocalByPartionerType.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/marshal/LocalByPartionerType.java b/src/java/org/apache/cassandra/db/marshal/LocalByPartionerType.java
index a19f48d..3595a16 100644
--- a/src/java/org/apache/cassandra/db/marshal/LocalByPartionerType.java
+++ b/src/java/org/apache/cassandra/db/marshal/LocalByPartionerType.java
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/marshal/LongType.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/marshal/LongType.java b/src/java/org/apache/cassandra/db/marshal/LongType.java
index b604cac..4bf5234 100644
--- a/src/java/org/apache/cassandra/db/marshal/LongType.java
+++ b/src/java/org/apache/cassandra/db/marshal/LongType.java
@@ -1,6 +1,6 @@
package org.apache.cassandra.db.marshal;
/*
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -8,16 +8,16 @@ package org.apache.cassandra.db.marshal;
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*/
@@ -56,8 +56,8 @@ public class LongType extends AbstractType<Long>
int diff = o1.get(o1.position()) - o2.get(o2.position());
if (diff != 0)
return diff;
-
-
+
+
return ByteBufferUtil.compareUnsigned(o1, o2);
}
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/marshal/MarshalException.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/marshal/MarshalException.java b/src/java/org/apache/cassandra/db/marshal/MarshalException.java
index 279f45d..7774c33 100644
--- a/src/java/org/apache/cassandra/db/marshal/MarshalException.java
+++ b/src/java/org/apache/cassandra/db/marshal/MarshalException.java
@@ -1,6 +1,6 @@
package org.apache.cassandra.db.marshal;
/*
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -8,16 +8,16 @@ package org.apache.cassandra.db.marshal;
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*/
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/marshal/TimeUUIDType.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/marshal/TimeUUIDType.java b/src/java/org/apache/cassandra/db/marshal/TimeUUIDType.java
index 81f226c..f2ed1f5 100644
--- a/src/java/org/apache/cassandra/db/marshal/TimeUUIDType.java
+++ b/src/java/org/apache/cassandra/db/marshal/TimeUUIDType.java
@@ -1,6 +1,6 @@
package org.apache.cassandra.db.marshal;
/*
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -8,16 +8,16 @@ package org.apache.cassandra.db.marshal;
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*/
@@ -114,9 +114,9 @@ public class TimeUUIDType extends AbstractType<UUID>
// Return an empty ByteBuffer for an empty string.
if (source.isEmpty())
return ByteBufferUtil.EMPTY_BYTE_BUFFER;
-
+
ByteBuffer idBytes = null;
-
+
// ffffffff-ffff-ffff-ffff-ffffffffff
if (regexPattern.matcher(source).matches())
{
@@ -130,7 +130,7 @@ public class TimeUUIDType extends AbstractType<UUID>
{
throw new MarshalException(String.format("unable to make UUID from '%s'", source), e);
}
-
+
if (uuid.version() != 1)
throw new MarshalException("TimeUUID supports only version 1 UUIDs");
}
@@ -163,7 +163,7 @@ public class TimeUUIDType extends AbstractType<UUID>
throw new MarshalException(String.format("unable to coerce '%s' to version 1 UUID", source), e1);
}
}
-
+
return idBytes;
}
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/marshal/UTF8Type.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/marshal/UTF8Type.java b/src/java/org/apache/cassandra/db/marshal/UTF8Type.java
index f4467e2..64ea92f 100644
--- a/src/java/org/apache/cassandra/db/marshal/UTF8Type.java
+++ b/src/java/org/apache/cassandra/db/marshal/UTF8Type.java
@@ -1,6 +1,6 @@
package org.apache.cassandra.db.marshal;
/*
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -8,16 +8,16 @@ package org.apache.cassandra.db.marshal;
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*/
import java.nio.ByteBuffer;
@@ -67,7 +67,7 @@ public class UTF8Type extends AbstractType<String>
if (!UTF8Validator.validate(bytes))
throw new MarshalException("String didn't validate.");
}
-
+
static class UTF8Validator
{
enum State {
@@ -79,11 +79,11 @@ public class UTF8Type extends AbstractType<String>
THREE_80bf_2,
FOUR_90bf,
FOUR_80bf_3,
- };
-
+ };
+
// since we're not converting to java strings, we don't need to worry about converting to surrogates.
// buf has already been sliced/duplicated.
- static boolean validate(ByteBuffer buf)
+ static boolean validate(ByteBuffer buf)
{
buf = buf.slice();
int b = 0;
@@ -118,7 +118,7 @@ public class UTF8Type extends AbstractType<String>
state = State.THREE_a0bf;
else
state = State.THREE_80bf_2;
- break;
+ break;
}
else if ((b >> 3) == -2)
{
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/marshal/UUIDType.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/marshal/UUIDType.java b/src/java/org/apache/cassandra/db/marshal/UUIDType.java
index e6ab166..69380d8 100644
--- a/src/java/org/apache/cassandra/db/marshal/UUIDType.java
+++ b/src/java/org/apache/cassandra/db/marshal/UUIDType.java
@@ -1,7 +1,7 @@
package org.apache.cassandra.db.marshal;
/*
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -9,16 +9,16 @@ package org.apache.cassandra.db.marshal;
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*/
import java.nio.ByteBuffer;
@@ -40,7 +40,7 @@ import static org.apache.cassandra.cql.jdbc.JdbcDate.iso8601Patterns;
* - nil UUID is always lesser<br>
* - compare timestamps if both are time-based<br>
* - compare lexically, unsigned msb-to-lsb comparison<br>
- *
+ *
* @see "com.fasterxml.uuid.UUIDComparator"
*/
public class UUIDType extends AbstractType<UUID>
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/migration/AddColumnFamily.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/migration/AddColumnFamily.java b/src/java/org/apache/cassandra/db/migration/AddColumnFamily.java
index 944ee9d..d3fd777 100644
--- a/src/java/org/apache/cassandra/db/migration/AddColumnFamily.java
+++ b/src/java/org/apache/cassandra/db/migration/AddColumnFamily.java
@@ -29,7 +29,7 @@ import org.apache.cassandra.db.RowMutation;
public class AddColumnFamily extends Migration
{
private final CFMetaData cfm;
-
+
public AddColumnFamily(CFMetaData cfm) throws ConfigurationException
{
super(System.nanoTime());
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/migration/AddKeyspace.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/migration/AddKeyspace.java b/src/java/org/apache/cassandra/db/migration/AddKeyspace.java
index d0f4bfd..432ebed 100644
--- a/src/java/org/apache/cassandra/db/migration/AddKeyspace.java
+++ b/src/java/org/apache/cassandra/db/migration/AddKeyspace.java
@@ -30,7 +30,7 @@ import org.apache.cassandra.db.RowMutation;
public class AddKeyspace extends Migration
{
private final KSMetaData ksm;
-
+
public AddKeyspace(KSMetaData ksm) throws ConfigurationException
{
super(System.nanoTime());
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/migration/DropColumnFamily.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/migration/DropColumnFamily.java b/src/java/org/apache/cassandra/db/migration/DropColumnFamily.java
index b83cf9d..727674f 100644
--- a/src/java/org/apache/cassandra/db/migration/DropColumnFamily.java
+++ b/src/java/org/apache/cassandra/db/migration/DropColumnFamily.java
@@ -29,7 +29,7 @@ public class DropColumnFamily extends Migration
{
private final String ksName;
private final String cfName;
-
+
public DropColumnFamily(String ksName, String cfName) throws ConfigurationException
{
super(System.nanoTime());
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/migration/DropKeyspace.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/migration/DropKeyspace.java b/src/java/org/apache/cassandra/db/migration/DropKeyspace.java
index 0fd8cb9..18c7f5e 100644
--- a/src/java/org/apache/cassandra/db/migration/DropKeyspace.java
+++ b/src/java/org/apache/cassandra/db/migration/DropKeyspace.java
@@ -29,7 +29,7 @@ import org.apache.cassandra.db.RowMutation;
public class DropKeyspace extends Migration
{
private final String name;
-
+
public DropKeyspace(String name) throws ConfigurationException
{
super(System.nanoTime());
@@ -45,7 +45,7 @@ public class DropKeyspace extends Migration
{
return MigrationHelper.dropKeyspace(name, timestamp);
}
-
+
@Override
public String toString()
{
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/db/migration/Migration.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/migration/Migration.java b/src/java/org/apache/cassandra/db/migration/Migration.java
index faf6784..4aaad5b 100644
--- a/src/java/org/apache/cassandra/db/migration/Migration.java
+++ b/src/java/org/apache/cassandra/db/migration/Migration.java
@@ -42,14 +42,14 @@ import org.apache.cassandra.utils.UUIDGen;
* There are two parts to a migration (think of it as a schema update):
* 1. data is written to the schema cf (SCHEMA_KEYSPACES_CF).
* 2. updated models are applied to the cassandra instance.
- *
+ *
* Since all steps are not committed atomically, care should be taken to ensure that a node/cluster is reasonably
* quiescent with regard to the Keyspace or ColumnFamily whose schema is being modified.
*/
public abstract class Migration
{
protected static final Logger logger = LoggerFactory.getLogger(Migration.class);
-
+
public static final String NAME_VALIDATOR_REGEX = "\\w+";
public static final String MIGRATIONS_CF = "Migrations";
public static final String SCHEMA_CF = "Schema";
@@ -120,7 +120,7 @@ public abstract class Migration
else
return UUIDGen.getUUID(cf.getColumn(LAST_MIGRATION_KEY).value());
}
-
+
public static boolean isLegalName(String s)
{
return s.matches(Migration.NAME_VALIDATOR_REGEX);
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/dht/AbstractBounds.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/dht/AbstractBounds.java b/src/java/org/apache/cassandra/dht/AbstractBounds.java
index b85fc65..da93292 100644
--- a/src/java/org/apache/cassandra/dht/AbstractBounds.java
+++ b/src/java/org/apache/cassandra/dht/AbstractBounds.java
@@ -1,6 +1,6 @@
package org.apache.cassandra.dht;
/*
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -8,16 +8,16 @@ package org.apache.cassandra.dht;
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*/
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/dht/BootStrapper.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/dht/BootStrapper.java b/src/java/org/apache/cassandra/dht/BootStrapper.java
index 6108214..74ec226 100644
--- a/src/java/org/apache/cassandra/dht/BootStrapper.java
+++ b/src/java/org/apache/cassandra/dht/BootStrapper.java
@@ -158,15 +158,15 @@ public class BootStrapper
assert !maxEndpoint.equals(FBUtilities.getBroadcastAddress());
if (metadata.pendingRangeChanges(maxEndpoint) > 0)
throw new RuntimeException("Every node is a bootstrap source! Please specify an initial token manually or wait for an existing bootstrap operation to finish.");
-
+
return maxEndpoint;
}
static Token<?> getBootstrapTokenFrom(InetAddress maxEndpoint)
{
Message message = new Message(FBUtilities.getBroadcastAddress(),
- StorageService.Verb.BOOTSTRAP_TOKEN,
- ArrayUtils.EMPTY_BYTE_ARRAY,
+ StorageService.Verb.BOOTSTRAP_TOKEN,
+ ArrayUtils.EMPTY_BYTE_ARRAY,
Gossiper.instance.getVersion(maxEndpoint));
int retries = 5;
long timeout = Math.max(MessagingService.getDefaultCallbackTimeout(), BOOTSTRAP_TIMEOUT);
http://git-wip-us.apache.org/repos/asf/cassandra/blob/07cdfd07/src/java/org/apache/cassandra/dht/Bounds.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/dht/Bounds.java b/src/java/org/apache/cassandra/dht/Bounds.java
index b521178..9ff830e 100644
--- a/src/java/org/apache/cassandra/dht/Bounds.java
+++ b/src/java/org/apache/cassandra/dht/Bounds.java
@@ -1,6 +1,6 @@
package org.apache.cassandra.dht;
/*
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -8,16 +8,16 @@ package org.apache.cassandra.dht;
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*/