From 2afe2bdeaecec09810b1a85b0e1e14eaa8291140 Mon Sep 17 00:00:00 2001 From: xvrl Date: Mon, 15 Apr 2013 09:28:32 -0700 Subject: [PATCH] formatting --- .../druid/index/v1/IncrementalIndex.java | 26 ++++++++++--------- .../v1/QueryableIndexStorageAdapter.java | 18 ++++++++----- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/index-common/src/main/java/com/metamx/druid/index/v1/IncrementalIndex.java b/index-common/src/main/java/com/metamx/druid/index/v1/IncrementalIndex.java index 4ee321a368e..cde0c61529b 100644 --- a/index-common/src/main/java/com/metamx/druid/index/v1/IncrementalIndex.java +++ b/index-common/src/main/java/com/metamx/druid/index/v1/IncrementalIndex.java @@ -227,20 +227,22 @@ public class IncrementalIndex implements Iterable final String typeName = agg.getTypeName(); final String columnName = column.toLowerCase(); - if(typeName.equals("float")) return new ObjectColumnSelector() - { - @Override - public Class classOfObject() + if(typeName.equals("float")) { + return new ObjectColumnSelector() { - return Float.TYPE; - } + @Override + public Class classOfObject() + { + return Float.TYPE; + } - @Override - public Float get() - { - return in.getFloatMetric(columnName); - } - }; + @Override + public Float get() + { + return in.getFloatMetric(columnName); + } + }; + } final ComplexMetricSerde serde = ComplexMetrics.getSerdeForType(typeName); diff --git a/server/src/main/java/com/metamx/druid/index/v1/QueryableIndexStorageAdapter.java b/server/src/main/java/com/metamx/druid/index/v1/QueryableIndexStorageAdapter.java index 883f43fd2c1..2f41b0d08a0 100644 --- a/server/src/main/java/com/metamx/druid/index/v1/QueryableIndexStorageAdapter.java +++ b/server/src/main/java/com/metamx/druid/index/v1/QueryableIndexStorageAdapter.java @@ -35,6 +35,7 @@ import com.metamx.druid.index.QueryableIndex; import com.metamx.druid.index.brita.BitmapIndexSelector; import com.metamx.druid.index.brita.Filter; import com.metamx.druid.index.column.Column; +import com.metamx.druid.index.column.ColumnCapabilities; import com.metamx.druid.index.column.ColumnSelector; import com.metamx.druid.index.column.ComplexColumn; import com.metamx.druid.index.column.DictionaryEncodedColumn; @@ -481,17 +482,18 @@ public class QueryableIndexStorageAdapter extends BaseStorageAdapter Column holder = index.getColumn(columnName); if(holder != null) { - if(holder.getCapabilities().hasMultipleValues()) { + final ColumnCapabilities capabilities = holder.getCapabilities(); + + if(capabilities.hasMultipleValues()) { throw new UnsupportedOperationException( "makeObjectColumnSelector does not support multivalued columns" ); } - final ValueType type = holder.getCapabilities().getType(); - if(holder.getCapabilities().isDictionaryEncoded()) { + if(capabilities.isDictionaryEncoded()) { cachedColumnVals = holder.getDictionaryEncoding(); } - else if(type == ValueType.COMPLEX) { + else if(capabilities.getType() == ValueType.COMPLEX) { cachedColumnVals = holder.getComplexColumn(); } else { @@ -499,7 +501,9 @@ public class QueryableIndexStorageAdapter extends BaseStorageAdapter } } - if(cachedColumnVals != null) objectColumnCache.put(columnName, cachedColumnVals); + if(cachedColumnVals != null) { + objectColumnCache.put(columnName, cachedColumnVals); + } } if (cachedColumnVals == null) { @@ -616,7 +620,9 @@ public class QueryableIndexStorageAdapter extends BaseStorageAdapter Closeables.closeQuietly(complexColumn); } for (Object column : complexColumnCache.values()) { - if(column instanceof Closeable) Closeables.closeQuietly((Closeable)column); + if(column instanceof Closeable) { + Closeables.closeQuietly((Closeable)column); + } } } }