Adding a bunch of missing apache license headers.
Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/48a9c1ee Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/48a9c1ee Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/48a9c1ee Branch: refs/heads/0.2-dev Commit: 48a9c1eed042a81691edef8642b34b26fe263951 Parents: a258581 Author: Aaron McCurry <[email protected]> Authored: Sat Feb 2 10:59:46 2013 -0500 Committer: Aaron McCurry <[email protected]> Committed: Sat Feb 2 10:59:46 2013 -0500 ---------------------------------------------------------------------- .../org/apache/blur/analysis/FieldManager.java | 76 ++++++-------- .../blur/analysis/IndexableFieldFactory.java | 17 +++- .../apache/blur/lucene/search/QueryConverter.java | 16 +++ .../blur/lucene/search/QueryConverterImpl.java | 16 +++ .../org/apache/blur/lucene/search/ScoreType.java | 16 +++ .../manager/clusterstatus/BaseClusterStatus.java | 25 ++++- .../clusterstatus/SimpleZKClusterStatus.java | 16 +++ .../org/apache/blur/manager/stats/LoadFactor.java | 1 - .../blur/manager/stats/MergerTableStats.java | 7 +- .../org/apache/blur/manager/writer/BlurIndex.java | 8 ++ .../java/org/apache/blur/server/Configurable.java | 31 +++--- .../java/org/apache/blur/server/Configured.java | 16 +++ .../apache/blur/server/QueryStatusContainer.java | 16 +++ .../java/org/apache/blur/server/ShardContext.java | 16 +++ .../java/org/apache/blur/server/TableLayout.java | 18 +++- .../apache/blur/thrift/AbstractThriftServer.java | 8 +- .../java/org/apache/blur/utils/BlurConstants.java | 3 +- .../blur/utils/BlurExecutorCompletionService.java | 1 - .../org/apache/blur/utils/BlurValidations.java | 6 +- .../main/java/org/apache/blur/utils/ForkJoin.java | 1 - .../java/org/apache/blur/utils/PrimeDocCache.java | 11 +- .../utils/ResetableDocumentStoredFieldVisitor.java | 31 +++--- .../org/apache/blur/utils/RowDocumentUtil.java | 1 - .../apache/blur/utils/ThriftLuceneConversion.java | 16 +++ 24 files changed, 268 insertions(+), 105 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/48a9c1ee/src/blur-core/src/main/java/org/apache/blur/analysis/FieldManager.java ---------------------------------------------------------------------- diff --git a/src/blur-core/src/main/java/org/apache/blur/analysis/FieldManager.java b/src/blur-core/src/main/java/org/apache/blur/analysis/FieldManager.java index 2c5e10d..277d166 100644 --- a/src/blur-core/src/main/java/org/apache/blur/analysis/FieldManager.java +++ b/src/blur-core/src/main/java/org/apache/blur/analysis/FieldManager.java @@ -1,5 +1,21 @@ package org.apache.blur.analysis; +/** + * 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 regarding copyright ownership. + * The ASF licenses this file 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.io.IOException; import java.util.HashMap; import java.util.HashSet; @@ -23,29 +39,11 @@ import org.apache.lucene.document.StringField; import org.apache.lucene.document.TextField; import org.apache.lucene.index.IndexableField; -/** - * 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 regarding copyright ownership. The ASF - * licenses this file 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. - */ - public class FieldManager { private Map<String, IndexableFieldFactory> indexableFieldFactories = new HashMap<String, IndexableFieldFactory>(); private Map<String, Set<String>> subIndexNameLookups = new HashMap<String, Set<String>>(); - public FieldManager() { } @@ -59,33 +57,25 @@ public class FieldManager { try { for (AnalyzerType analyzerType : analyzerTypes) { String indexName = analyzerType.getFieldName(); - org.apache.blur.thrift.generated.ClassDefinition analyzerClassDefinition = analyzerType - .getClassDefinition(); + org.apache.blur.thrift.generated.ClassDefinition analyzerClassDefinition = analyzerType.getClassDefinition(); if (analyzerClassDefinition != null) { String indexableFieldFactoryClassName = analyzerClassDefinition.getClassName(); - Object indexableFieldFactoryObject = (indexableFieldFactoryClassName == null) ? null : Class - .forName(indexableFieldFactoryClassName).newInstance(); + Object indexableFieldFactoryObject = (indexableFieldFactoryClassName == null) ? null : Class.forName(indexableFieldFactoryClassName).newInstance(); - if (indexableFieldFactoryObject != null - && indexableFieldFactoryObject instanceof IndexableFieldFactory) { - indexableFieldFactories.put(indexName, - (IndexableFieldFactory) indexableFieldFactoryObject); + if (indexableFieldFactoryObject != null && indexableFieldFactoryObject instanceof IndexableFieldFactory) { + indexableFieldFactories.put(indexName, (IndexableFieldFactory) indexableFieldFactoryObject); } } - List<AnalyzerSubType> analyzerSubTypes = analyzerType - .getAnalyzerSubTypes(); + List<AnalyzerSubType> analyzerSubTypes = analyzerType.getAnalyzerSubTypes(); if (analyzerSubTypes != null && analyzerSubTypes.size() > 0) { HashSet<String> subIndexNames = new HashSet<String>(); - + for (AnalyzerSubType analyzerSubType : analyzerSubTypes) { String subIndexName = analyzerSubType.getSubFieldName(); - String subIndexableFieldFactoryClassName = analyzerSubType.getClassDefinition() - .getClassName(); - Object subIndexableFieldFactoryObject = subIndexableFieldFactoryClassName == null ? null - : Class.forName(subIndexableFieldFactoryClassName).newInstance(); - if (subIndexableFieldFactoryObject != null - && subIndexableFieldFactoryObject instanceof Analyzer) { - indexableFieldFactories.put(indexName,(IndexableFieldFactory) subIndexableFieldFactoryObject); + String subIndexableFieldFactoryClassName = analyzerSubType.getClassDefinition().getClassName(); + Object subIndexableFieldFactoryObject = subIndexableFieldFactoryClassName == null ? null : Class.forName(subIndexableFieldFactoryClassName).newInstance(); + if (subIndexableFieldFactoryObject != null && subIndexableFieldFactoryObject instanceof Analyzer) { + indexableFieldFactories.put(indexName, (IndexableFieldFactory) subIndexableFieldFactoryObject); subIndexNames.add(subIndexName); } } @@ -100,21 +90,21 @@ public class FieldManager { throw new RuntimeException(e); } } - - public IndexableField getIndexableField(Field field){ + + public IndexableField getIndexableField(Field field) { IndexableFieldFactory factory = indexableFieldFactories.get(field.getName()); return factory.getIndexableField(field) == null ? null : factory.getIndexableField(field); } - - public IndexableFieldFactory getIndexableFieldFactory(String fieldName){ + + public IndexableFieldFactory getIndexableFieldFactory(String fieldName) { IndexableFieldFactory factory = indexableFieldFactories.get(fieldName); return factory == null ? null : factory; } - + public Set<String> getSubIndexNames(String indexName) { return subIndexNameLookups.get(indexName); } - + public static IndexableField toLucene(Field field) throws IOException { TYPE type = field.getType(); org.apache.lucene.document.Field result; @@ -149,7 +139,7 @@ public class FieldManager { } return result; } - + public static double toDouble(byte[] value) { throw new RuntimeException("Not implemented"); } http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/48a9c1ee/src/blur-core/src/main/java/org/apache/blur/analysis/IndexableFieldFactory.java ---------------------------------------------------------------------- diff --git a/src/blur-core/src/main/java/org/apache/blur/analysis/IndexableFieldFactory.java b/src/blur-core/src/main/java/org/apache/blur/analysis/IndexableFieldFactory.java index 9fd82f2..463cd08 100644 --- a/src/blur-core/src/main/java/org/apache/blur/analysis/IndexableFieldFactory.java +++ b/src/blur-core/src/main/java/org/apache/blur/analysis/IndexableFieldFactory.java @@ -1,5 +1,20 @@ package org.apache.blur.analysis; - +/** + * 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 regarding copyright ownership. + * The ASF licenses this file 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 org.apache.blur.thrift.generated.Field; import org.apache.lucene.index.IndexableField; http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/48a9c1ee/src/blur-core/src/main/java/org/apache/blur/lucene/search/QueryConverter.java ---------------------------------------------------------------------- diff --git a/src/blur-core/src/main/java/org/apache/blur/lucene/search/QueryConverter.java b/src/blur-core/src/main/java/org/apache/blur/lucene/search/QueryConverter.java index a9ec238..40e59d6 100644 --- a/src/blur-core/src/main/java/org/apache/blur/lucene/search/QueryConverter.java +++ b/src/blur-core/src/main/java/org/apache/blur/lucene/search/QueryConverter.java @@ -1,5 +1,21 @@ package org.apache.blur.lucene.search; +/** + * 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 regarding copyright ownership. + * The ASF licenses this file 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.io.IOException; import org.apache.blur.thrift.generated.Query; http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/48a9c1ee/src/blur-core/src/main/java/org/apache/blur/lucene/search/QueryConverterImpl.java ---------------------------------------------------------------------- diff --git a/src/blur-core/src/main/java/org/apache/blur/lucene/search/QueryConverterImpl.java b/src/blur-core/src/main/java/org/apache/blur/lucene/search/QueryConverterImpl.java index cd931be..9cbeff4 100644 --- a/src/blur-core/src/main/java/org/apache/blur/lucene/search/QueryConverterImpl.java +++ b/src/blur-core/src/main/java/org/apache/blur/lucene/search/QueryConverterImpl.java @@ -1,5 +1,21 @@ package org.apache.blur.lucene.search; +/** + * 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 regarding copyright ownership. + * The ASF licenses this file 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.io.IOException; import org.apache.blur.analysis.BlurAnalyzer; http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/48a9c1ee/src/blur-core/src/main/java/org/apache/blur/lucene/search/ScoreType.java ---------------------------------------------------------------------- diff --git a/src/blur-core/src/main/java/org/apache/blur/lucene/search/ScoreType.java b/src/blur-core/src/main/java/org/apache/blur/lucene/search/ScoreType.java index d684726..f32c7f0 100644 --- a/src/blur-core/src/main/java/org/apache/blur/lucene/search/ScoreType.java +++ b/src/blur-core/src/main/java/org/apache/blur/lucene/search/ScoreType.java @@ -1,5 +1,21 @@ package org.apache.blur.lucene.search; +/** + * 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 regarding copyright ownership. The ASF + * licenses this file 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. + */ public enum ScoreType { AGGREGATE, BEST, CONSTANT, SUPER http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/48a9c1ee/src/blur-core/src/main/java/org/apache/blur/manager/clusterstatus/BaseClusterStatus.java ---------------------------------------------------------------------- diff --git a/src/blur-core/src/main/java/org/apache/blur/manager/clusterstatus/BaseClusterStatus.java b/src/blur-core/src/main/java/org/apache/blur/manager/clusterstatus/BaseClusterStatus.java index 7695dde..e7a7e5b 100644 --- a/src/blur-core/src/main/java/org/apache/blur/manager/clusterstatus/BaseClusterStatus.java +++ b/src/blur-core/src/main/java/org/apache/blur/manager/clusterstatus/BaseClusterStatus.java @@ -1,5 +1,21 @@ package org.apache.blur.manager.clusterstatus; +/** + * 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 regarding copyright ownership. + * The ASF licenses this file 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.io.IOException; import java.util.List; @@ -19,7 +35,6 @@ public abstract class BaseClusterStatus extends ClusterStatus { public abstract ZooKeeper getZooKeeper(); - private byte[] getData(String path) throws KeeperException, InterruptedException { Stat stat = getZooKeeper().exists(path, false); if (stat == null) { @@ -27,7 +42,7 @@ public abstract class BaseClusterStatus extends ClusterStatus { } return getZooKeeper().getData(path, false, stat); } - + @Override public TableDescriptor getTableDescriptor(boolean useCache, String table) { TableDescriptor tableDescriptor = new TableDescriptor(); @@ -133,7 +148,7 @@ public abstract class BaseClusterStatus extends ClusterStatus { throw new RuntimeException(e); } } - + @Override public List<String> getOnlineServers(boolean useCache) { try { @@ -155,7 +170,7 @@ public abstract class BaseClusterStatus extends ClusterStatus { throw new RuntimeException(e); } } - + @Override public boolean exists(boolean useCache, String table) { List<String> tableList = getTableList(useCache); @@ -186,7 +201,7 @@ public abstract class BaseClusterStatus extends ClusterStatus { throw new RuntimeException(e); } } - + @Override public List<String> getTableList(boolean useCache) { try { http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/48a9c1ee/src/blur-core/src/main/java/org/apache/blur/manager/clusterstatus/SimpleZKClusterStatus.java ---------------------------------------------------------------------- diff --git a/src/blur-core/src/main/java/org/apache/blur/manager/clusterstatus/SimpleZKClusterStatus.java b/src/blur-core/src/main/java/org/apache/blur/manager/clusterstatus/SimpleZKClusterStatus.java index e9a021a..c9a5535 100644 --- a/src/blur-core/src/main/java/org/apache/blur/manager/clusterstatus/SimpleZKClusterStatus.java +++ b/src/blur-core/src/main/java/org/apache/blur/manager/clusterstatus/SimpleZKClusterStatus.java @@ -1,5 +1,21 @@ package org.apache.blur.manager.clusterstatus; +/** + * 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 regarding copyright ownership. + * The ASF licenses this file 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.util.concurrent.atomic.AtomicBoolean; import org.apache.blur.log.Log; http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/48a9c1ee/src/blur-core/src/main/java/org/apache/blur/manager/stats/LoadFactor.java ---------------------------------------------------------------------- diff --git a/src/blur-core/src/main/java/org/apache/blur/manager/stats/LoadFactor.java b/src/blur-core/src/main/java/org/apache/blur/manager/stats/LoadFactor.java index c1d2cba..334eba1 100644 --- a/src/blur-core/src/main/java/org/apache/blur/manager/stats/LoadFactor.java +++ b/src/blur-core/src/main/java/org/apache/blur/manager/stats/LoadFactor.java @@ -27,7 +27,6 @@ import java.util.concurrent.TimeUnit; import org.apache.blur.log.Log; import org.apache.blur.log.LogFactory; - public class LoadFactor { private static final Log LOG = LogFactory.getLog(LoadFactor.class); http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/48a9c1ee/src/blur-core/src/main/java/org/apache/blur/manager/stats/MergerTableStats.java ---------------------------------------------------------------------- diff --git a/src/blur-core/src/main/java/org/apache/blur/manager/stats/MergerTableStats.java b/src/blur-core/src/main/java/org/apache/blur/manager/stats/MergerTableStats.java index 56189f4..c2830f7 100644 --- a/src/blur-core/src/main/java/org/apache/blur/manager/stats/MergerTableStats.java +++ b/src/blur-core/src/main/java/org/apache/blur/manager/stats/MergerTableStats.java @@ -24,7 +24,6 @@ import org.apache.blur.thrift.generated.TableStats; import org.apache.blur.utils.BlurExecutorCompletionService; import org.apache.blur.utils.ForkJoin.Merger; - public class MergerTableStats implements Merger<TableStats> { private long _timeout; @@ -45,10 +44,10 @@ public class MergerTableStats implements Merger<TableStats> { } private TableStats merge(TableStats s1, TableStats s2) { -// s1.tableName = s2.tableName; + // s1.tableName = s2.tableName; s1.bytes = Math.max(s1.bytes, s2.bytes); -// s1.recordCount = s1.recordCount + s2.recordCount; -// s1.rowCount = s1.rowCount + s2.rowCount; + // s1.recordCount = s1.recordCount + s2.recordCount; + // s1.rowCount = s1.rowCount + s2.rowCount; s1.queries = Math.max(s1.queries, s2.queries); return s1; } http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/48a9c1ee/src/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndex.java ---------------------------------------------------------------------- diff --git a/src/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndex.java b/src/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndex.java index 2e5105a..d7dce38 100644 --- a/src/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndex.java +++ b/src/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndex.java @@ -29,15 +29,23 @@ import org.apache.lucene.index.IndexReader; public abstract class BlurIndex { public abstract IndexReader getIndexReader() throws IOException; + public abstract void close() throws IOException; + public abstract void refresh() throws IOException; + public abstract AtomicBoolean isClosed(); + public abstract void optimize(int numberOfSegmentsPerShard) throws IOException; public abstract long addDocuments(boolean waitToBeVisible, boolean wal, List<Document> documents) throws IOException; + public abstract long deleteDocuments(boolean waitToBeVisible, boolean wal, Term... deleteTerms) throws IOException; + public abstract long deleteDocuments(boolean waitToBeVisible, boolean wal, Query... deleteQueries) throws IOException; + public abstract long updateDocuments(boolean waitToBeVisible, boolean wal, List<UpdatePackage> updatePackages) throws IOException; + public abstract void blockUntilGenerationIsVisible(long generation, boolean forceRefresh) throws IOException; } http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/48a9c1ee/src/blur-core/src/main/java/org/apache/blur/server/Configurable.java ---------------------------------------------------------------------- diff --git a/src/blur-core/src/main/java/org/apache/blur/server/Configurable.java b/src/blur-core/src/main/java/org/apache/blur/server/Configurable.java index 368198f..01b9268 100644 --- a/src/blur-core/src/main/java/org/apache/blur/server/Configurable.java +++ b/src/blur-core/src/main/java/org/apache/blur/server/Configurable.java @@ -1,22 +1,21 @@ +package org.apache.blur.server; + /** - * 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 - * regarding copyright ownership. The ASF licenses this file - * 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 - * + * 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 regarding copyright ownership. The ASF + * licenses this file 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. + * 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.blur.server; - public interface Configurable { public void setTableContext(TableContext context); http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/48a9c1ee/src/blur-core/src/main/java/org/apache/blur/server/Configured.java ---------------------------------------------------------------------- diff --git a/src/blur-core/src/main/java/org/apache/blur/server/Configured.java b/src/blur-core/src/main/java/org/apache/blur/server/Configured.java index b477de0..484a148 100644 --- a/src/blur-core/src/main/java/org/apache/blur/server/Configured.java +++ b/src/blur-core/src/main/java/org/apache/blur/server/Configured.java @@ -1,5 +1,21 @@ package org.apache.blur.server; +/** + * 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 regarding copyright ownership. The ASF + * licenses this file 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. + */ public abstract class Configured implements Configurable { http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/48a9c1ee/src/blur-core/src/main/java/org/apache/blur/server/QueryStatusContainer.java ---------------------------------------------------------------------- diff --git a/src/blur-core/src/main/java/org/apache/blur/server/QueryStatusContainer.java b/src/blur-core/src/main/java/org/apache/blur/server/QueryStatusContainer.java index f0c0b5e..157304e 100644 --- a/src/blur-core/src/main/java/org/apache/blur/server/QueryStatusContainer.java +++ b/src/blur-core/src/main/java/org/apache/blur/server/QueryStatusContainer.java @@ -1,5 +1,21 @@ package org.apache.blur.server; +/** + * 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 regarding copyright ownership. + * The ASF licenses this file 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.util.ArrayList; import java.util.HashMap; import java.util.List; http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/48a9c1ee/src/blur-core/src/main/java/org/apache/blur/server/ShardContext.java ---------------------------------------------------------------------- diff --git a/src/blur-core/src/main/java/org/apache/blur/server/ShardContext.java b/src/blur-core/src/main/java/org/apache/blur/server/ShardContext.java index 7b7d864..0b0f808 100644 --- a/src/blur-core/src/main/java/org/apache/blur/server/ShardContext.java +++ b/src/blur-core/src/main/java/org/apache/blur/server/ShardContext.java @@ -1,5 +1,21 @@ package org.apache.blur.server; +/** + * 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 regarding copyright ownership. + * The ASF licenses this file 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.io.IOException; import org.apache.blur.store.hdfs.HdfsDirectory; http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/48a9c1ee/src/blur-core/src/main/java/org/apache/blur/server/TableLayout.java ---------------------------------------------------------------------- diff --git a/src/blur-core/src/main/java/org/apache/blur/server/TableLayout.java b/src/blur-core/src/main/java/org/apache/blur/server/TableLayout.java index 478976a..88ee8c3 100644 --- a/src/blur-core/src/main/java/org/apache/blur/server/TableLayout.java +++ b/src/blur-core/src/main/java/org/apache/blur/server/TableLayout.java @@ -1,11 +1,27 @@ package org.apache.blur.server; +/** + * 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 regarding copyright ownership. The ASF + * licenses this file 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. + */ public abstract class TableLayout { public enum TYPE { WRITABLE, ONLINE, BACKUP } - + public abstract String findServer(String table, int shard, TYPE type); } http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/48a9c1ee/src/blur-core/src/main/java/org/apache/blur/thrift/AbstractThriftServer.java ---------------------------------------------------------------------- diff --git a/src/blur-core/src/main/java/org/apache/blur/thrift/AbstractThriftServer.java b/src/blur-core/src/main/java/org/apache/blur/thrift/AbstractThriftServer.java index da1775e..59f1bdd 100644 --- a/src/blur-core/src/main/java/org/apache/blur/thrift/AbstractThriftServer.java +++ b/src/blur-core/src/main/java/org/apache/blur/thrift/AbstractThriftServer.java @@ -29,14 +29,11 @@ import org.apache.blur.log.Log; import org.apache.blur.log.LogFactory; import org.apache.blur.manager.indexserver.BlurServerShutDown.BlurShutdown; import org.apache.blur.thrift.ExecutorServicePerMethodCallThriftServer.Args; -import org.apache.blur.thrift.generated.Blur; -import org.apache.blur.thrift.generated.Blur.Iface; import org.apache.thrift.TBaseProcessor; import org.apache.thrift.server.TServer; import org.apache.thrift.transport.TNonblockingServerSocket; import org.apache.thrift.transport.TTransportException; - public abstract class AbstractThriftServer { private static final Log LOG = LogFactory.getLog(AbstractThriftServer.class); @@ -77,7 +74,8 @@ public abstract class AbstractThriftServer { } public void start() throws TTransportException { -// Blur.Processor<Blur.Iface> processor = new Blur.Processor<Blur.Iface>(_iface); + // Blur.Processor<Blur.Iface> processor = new + // Blur.Processor<Blur.Iface>(_iface); TNonblockingServerSocket serverTransport = new TNonblockingServerSocket(getBindInetSocketAddress(_configuration)); Args args = new Args(serverTransport); @@ -150,7 +148,7 @@ public abstract class AbstractThriftServer { public void setShutdown(BlurShutdown shutdown) { this._shutdown = shutdown; } - + public TBaseProcessor<?> getProcessor() { return _processor; } http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/48a9c1ee/src/blur-core/src/main/java/org/apache/blur/utils/BlurConstants.java ---------------------------------------------------------------------- diff --git a/src/blur-core/src/main/java/org/apache/blur/utils/BlurConstants.java b/src/blur-core/src/main/java/org/apache/blur/utils/BlurConstants.java index 4b33aee..17b107f 100644 --- a/src/blur-core/src/main/java/org/apache/blur/utils/BlurConstants.java +++ b/src/blur-core/src/main/java/org/apache/blur/utils/BlurConstants.java @@ -22,7 +22,6 @@ import java.util.concurrent.TimeUnit; import org.apache.blur.BlurConfiguration; import org.apache.lucene.index.Term; - public class BlurConstants { public static final String CONTROLLER = "controller"; @@ -65,7 +64,7 @@ public class BlurConstants { public static final String BLUR_SHARD_TIME_BETWEEN_COMMITS = "blur.shard.time.between.commits"; public static final String BLUR_SHARD_TIME_BETWEEN_REFRESHS = "blur.shard.time.between.refreshs"; - + public static final String BLUR_QUERY_CONVERTER_CLASS = "blur.query.converter.class"; public static final String BLUR_LUCENE_INDEX_SIMILARITY_CLASS = "blur.lucene.index.similarity.class"; public static final String BLUR_LUCENE_INDEX_DELETION_POLICY_CLASS = "blur.lucene.index.deletion.policy.class"; http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/48a9c1ee/src/blur-core/src/main/java/org/apache/blur/utils/BlurExecutorCompletionService.java ---------------------------------------------------------------------- diff --git a/src/blur-core/src/main/java/org/apache/blur/utils/BlurExecutorCompletionService.java b/src/blur-core/src/main/java/org/apache/blur/utils/BlurExecutorCompletionService.java index 44327da..b0069dc 100644 --- a/src/blur-core/src/main/java/org/apache/blur/utils/BlurExecutorCompletionService.java +++ b/src/blur-core/src/main/java/org/apache/blur/utils/BlurExecutorCompletionService.java @@ -31,7 +31,6 @@ import java.util.concurrent.atomic.AtomicInteger; import org.apache.blur.thrift.BException; import org.apache.blur.thrift.generated.BlurException; - public class BlurExecutorCompletionService<T> extends ExecutorCompletionService<T> { private AtomicInteger count = new AtomicInteger(0); http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/48a9c1ee/src/blur-core/src/main/java/org/apache/blur/utils/BlurValidations.java ---------------------------------------------------------------------- diff --git a/src/blur-core/src/main/java/org/apache/blur/utils/BlurValidations.java b/src/blur-core/src/main/java/org/apache/blur/utils/BlurValidations.java index 5ae5140..a2eed46 100644 --- a/src/blur-core/src/main/java/org/apache/blur/utils/BlurValidations.java +++ b/src/blur-core/src/main/java/org/apache/blur/utils/BlurValidations.java @@ -28,7 +28,7 @@ import org.apache.blur.thrift.generated.UpdatePackage; public class BlurValidations { public static List<UpdatePackage> getAllIndexablePackages(List<UpdatePackage> updatePackages) { - for(UpdatePackage updatePackage : updatePackages){ + for (UpdatePackage updatePackage : updatePackages) { List<Document> documents = getAllIndexableDocuments(updatePackage.getDocuments()); updatePackage.setDocuments(documents); } @@ -37,9 +37,9 @@ public class BlurValidations { public static List<Document> getAllIndexableDocuments(List<Document> documents) { Iterator<Document> itr = documents.iterator(); - while(itr.hasNext()){ + while (itr.hasNext()) { boolean isDocumentIndexable = checkIfAnyFieldIsIndexable(itr.next()); - if(!isDocumentIndexable){ + if (!isDocumentIndexable) { itr.remove(); } } http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/48a9c1ee/src/blur-core/src/main/java/org/apache/blur/utils/ForkJoin.java ---------------------------------------------------------------------- diff --git a/src/blur-core/src/main/java/org/apache/blur/utils/ForkJoin.java b/src/blur-core/src/main/java/org/apache/blur/utils/ForkJoin.java index 2ae88cc..f828573 100644 --- a/src/blur-core/src/main/java/org/apache/blur/utils/ForkJoin.java +++ b/src/blur-core/src/main/java/org/apache/blur/utils/ForkJoin.java @@ -26,7 +26,6 @@ import org.apache.blur.log.LogFactory; import org.apache.blur.thrift.generated.BlurException; import org.apache.blur.utils.BlurExecutorCompletionService.Cancel; - public class ForkJoin { private static Log LOG = LogFactory.getLog(ForkJoin.class); http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/48a9c1ee/src/blur-core/src/main/java/org/apache/blur/utils/PrimeDocCache.java ---------------------------------------------------------------------- diff --git a/src/blur-core/src/main/java/org/apache/blur/utils/PrimeDocCache.java b/src/blur-core/src/main/java/org/apache/blur/utils/PrimeDocCache.java index f10502d..f66116c 100644 --- a/src/blur-core/src/main/java/org/apache/blur/utils/PrimeDocCache.java +++ b/src/blur-core/src/main/java/org/apache/blur/utils/PrimeDocCache.java @@ -31,7 +31,6 @@ import org.apache.lucene.search.Scorer; import org.apache.lucene.search.TermQuery; import org.apache.lucene.util.OpenBitSet; - public class PrimeDocCache { private static final Log LOG = LogFactory.getLog(PrimeDocCache.class); @@ -62,21 +61,21 @@ public class PrimeDocCache { primeDocMap.put(key, bs); IndexSearcher searcher = new IndexSearcher(reader); searcher.search(new TermQuery(BlurConstants.PRIME_DOC_TERM), new Collector() { - + @Override public void setScorer(Scorer scorer) throws IOException { - + } - + @Override public void setNextReader(AtomicReaderContext atomicReaderContext) throws IOException { } - + @Override public void collect(int doc) throws IOException { bs.set(doc); } - + @Override public boolean acceptsDocsOutOfOrder() { return false; http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/48a9c1ee/src/blur-core/src/main/java/org/apache/blur/utils/ResetableDocumentStoredFieldVisitor.java ---------------------------------------------------------------------- diff --git a/src/blur-core/src/main/java/org/apache/blur/utils/ResetableDocumentStoredFieldVisitor.java b/src/blur-core/src/main/java/org/apache/blur/utils/ResetableDocumentStoredFieldVisitor.java index 24fee3e..3beaa31 100644 --- a/src/blur-core/src/main/java/org/apache/blur/utils/ResetableDocumentStoredFieldVisitor.java +++ b/src/blur-core/src/main/java/org/apache/blur/utils/ResetableDocumentStoredFieldVisitor.java @@ -1,6 +1,6 @@ package org.apache.blur.utils; -/* +/** * 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 regarding copyright ownership. @@ -30,14 +30,15 @@ import org.apache.lucene.index.FieldInfo; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.StoredFieldVisitor; -/** A {@link StoredFieldVisitor} that creates a {@link - * Document} containing all stored fields, or only specific - * requested fields provided to {@link #DocumentStoredFieldVisitor(Set)}. - * <p> - * This is used by {@link IndexReader#document(int)} to load a - * document. - * - * @lucene.experimental */ +/** + * A {@link StoredFieldVisitor} that creates a {@link Document} containing all + * stored fields, or only specific requested fields provided to + * {@link #DocumentStoredFieldVisitor(Set)}. + * <p> + * This is used by {@link IndexReader#document(int)} to load a document. + * + * @lucene.experimental + */ public class ResetableDocumentStoredFieldVisitor extends StoredFieldVisitor { private Document doc = new Document(); @@ -51,7 +52,7 @@ public class ResetableDocumentStoredFieldVisitor extends StoredFieldVisitor { /** Load only fields named in the provided <code>Set<String></code>. */ public ResetableDocumentStoredFieldVisitor(String... fields) { fieldsToAdd = new HashSet<String>(fields.length); - for(String field : fields) { + for (String field : fields) { fieldsToAdd.add(field); } } @@ -103,15 +104,15 @@ public class ResetableDocumentStoredFieldVisitor extends StoredFieldVisitor { /** * Retrieve the visited document. - * @return Document populated with stored fields. Note that only - * the stored information in the field instances is valid, - * data such as boosts, indexing options, term vector options, - * etc is not set. + * + * @return Document populated with stored fields. Note that only the stored + * information in the field instances is valid, data such as boosts, + * indexing options, term vector options, etc is not set. */ public Document getDocument() { return doc; } - + public void reset() { doc = new Document(); } http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/48a9c1ee/src/blur-core/src/main/java/org/apache/blur/utils/RowDocumentUtil.java ---------------------------------------------------------------------- diff --git a/src/blur-core/src/main/java/org/apache/blur/utils/RowDocumentUtil.java b/src/blur-core/src/main/java/org/apache/blur/utils/RowDocumentUtil.java index 3863339..e062096 100644 --- a/src/blur-core/src/main/java/org/apache/blur/utils/RowDocumentUtil.java +++ b/src/blur-core/src/main/java/org/apache/blur/utils/RowDocumentUtil.java @@ -23,7 +23,6 @@ import static org.apache.blur.utils.BlurConstants.SEP; import org.apache.lucene.document.Document; import org.apache.lucene.index.IndexableField; - public class RowDocumentUtil { public static String readRecord(Document document, ReaderBlurRecord reader) { http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/48a9c1ee/src/blur-core/src/main/java/org/apache/blur/utils/ThriftLuceneConversion.java ---------------------------------------------------------------------- diff --git a/src/blur-core/src/main/java/org/apache/blur/utils/ThriftLuceneConversion.java b/src/blur-core/src/main/java/org/apache/blur/utils/ThriftLuceneConversion.java index b121855..70a7fe4 100644 --- a/src/blur-core/src/main/java/org/apache/blur/utils/ThriftLuceneConversion.java +++ b/src/blur-core/src/main/java/org/apache/blur/utils/ThriftLuceneConversion.java @@ -1,5 +1,21 @@ package org.apache.blur.utils; +/** + * 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 regarding copyright ownership. + * The ASF licenses this file 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.io.IOException; import java.nio.ByteBuffer; import java.util.ArrayList;
