Repository: incubator-blur Updated Branches: refs/heads/master 2fed63d6a -> 42a77a51e
Refactored the cluster command into an interface and tried to clean up the API a bit more. Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/42a77a51 Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/42a77a51 Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/42a77a51 Branch: refs/heads/master Commit: 42a77a51e4fd78c63e8853a0fd6e6d7f5b90df14 Parents: 2fed63d Author: Aaron McCurry <[email protected]> Authored: Thu Aug 28 08:30:15 2014 -0400 Committer: Aaron McCurry <[email protected]> Committed: Thu Aug 28 08:30:15 2014 -0400 ---------------------------------------------------------------------- .../blur/manager/command/ClusterCommand.java | 16 +------ .../blur/manager/command/CommandAggregator.java | 27 +++++++++++ .../command/ControllerCommandManager.java | 5 ++- .../blur/manager/command/IndexReadCommand.java | 27 +++++++++++ .../manager/command/IndexReadWriteCommand.java | 28 ++++++++++++ .../manager/command/ShardCommandManager.java | 35 +++++++-------- .../manager/command/cluster/DocumentCount.java | 42 ----------------- .../cluster/DocumentCountAggregator.java | 47 -------------------- .../manager/command/primitive/BaseCommand.java | 35 +++++++++++++++ .../command/primitive/DocumentCount.java | 7 ++- .../primitive/DocumentCountAggregator.java | 24 +++++++++- .../command/primitive/PrimitiveCommand.java | 35 --------------- .../primitive/PrimitiveCommandAggregator.java | 27 ----------- .../manager/command/primitive/ReadCommand.java | 37 --------------- .../command/primitive/ReadWriteCommand.java | 38 ---------------- 15 files changed, 166 insertions(+), 264 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/42a77a51/blur-core/src/main/java/org/apache/blur/manager/command/ClusterCommand.java ---------------------------------------------------------------------- diff --git a/blur-core/src/main/java/org/apache/blur/manager/command/ClusterCommand.java b/blur-core/src/main/java/org/apache/blur/manager/command/ClusterCommand.java index f2bf9d3..2d04e8a 100644 --- a/blur-core/src/main/java/org/apache/blur/manager/command/ClusterCommand.java +++ b/blur-core/src/main/java/org/apache/blur/manager/command/ClusterCommand.java @@ -19,20 +19,8 @@ import java.io.Serializable; * the License. */ -@SuppressWarnings("serial") -public abstract class ClusterCommand implements Serializable, Cloneable { +public interface ClusterCommand<T> extends Serializable, Cloneable { - public abstract String getName(); - - @Override - public ClusterCommand clone() { - try { - return (ClusterCommand) super.clone(); - } catch (CloneNotSupportedException e) { - throw new RuntimeException(e); - } - } - - public abstract Response execute(Args args, CommandContext context); + T clusterExecute(Args args, CommandContext context); } http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/42a77a51/blur-core/src/main/java/org/apache/blur/manager/command/CommandAggregator.java ---------------------------------------------------------------------- diff --git a/blur-core/src/main/java/org/apache/blur/manager/command/CommandAggregator.java b/blur-core/src/main/java/org/apache/blur/manager/command/CommandAggregator.java new file mode 100644 index 0000000..e46b289 --- /dev/null +++ b/blur-core/src/main/java/org/apache/blur/manager/command/CommandAggregator.java @@ -0,0 +1,27 @@ +/** + * 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. + */ +package org.apache.blur.manager.command; + +import java.io.IOException; +import java.util.Iterator; +import java.util.Map.Entry; + +public interface CommandAggregator<IN, OUT> { + + OUT aggregate(Iterator<Entry<String, IN>> it) throws IOException; + +} http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/42a77a51/blur-core/src/main/java/org/apache/blur/manager/command/ControllerCommandManager.java ---------------------------------------------------------------------- diff --git a/blur-core/src/main/java/org/apache/blur/manager/command/ControllerCommandManager.java b/blur-core/src/main/java/org/apache/blur/manager/command/ControllerCommandManager.java index 5286b41..a3503dd 100644 --- a/blur-core/src/main/java/org/apache/blur/manager/command/ControllerCommandManager.java +++ b/blur-core/src/main/java/org/apache/blur/manager/command/ControllerCommandManager.java @@ -22,7 +22,10 @@ public class ControllerCommandManager { public Response execute(String table, String commandName, Args args) { CommandContext context = createCommandContext(table); ClusterCommand clusterCommand = getCommand(commandName); - return clusterCommand.execute(args, context); + + // For those commands that do not implement cluster command, run them in a base impl. + + throw new RuntimeException("Not Implemented"); } private ClusterCommand getCommand(String commandName) { http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/42a77a51/blur-core/src/main/java/org/apache/blur/manager/command/IndexReadCommand.java ---------------------------------------------------------------------- diff --git a/blur-core/src/main/java/org/apache/blur/manager/command/IndexReadCommand.java b/blur-core/src/main/java/org/apache/blur/manager/command/IndexReadCommand.java new file mode 100644 index 0000000..c7646d1 --- /dev/null +++ b/blur-core/src/main/java/org/apache/blur/manager/command/IndexReadCommand.java @@ -0,0 +1,27 @@ +/** + * 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. + */ +package org.apache.blur.manager.command; + +import java.io.IOException; + +import org.apache.lucene.search.IndexSearcher; + +public interface IndexReadCommand<T> { + + T execute(Args args, IndexSearcher searcher) throws IOException; + +} http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/42a77a51/blur-core/src/main/java/org/apache/blur/manager/command/IndexReadWriteCommand.java ---------------------------------------------------------------------- diff --git a/blur-core/src/main/java/org/apache/blur/manager/command/IndexReadWriteCommand.java b/blur-core/src/main/java/org/apache/blur/manager/command/IndexReadWriteCommand.java new file mode 100644 index 0000000..4eb5f7e --- /dev/null +++ b/blur-core/src/main/java/org/apache/blur/manager/command/IndexReadWriteCommand.java @@ -0,0 +1,28 @@ +/** + * 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. + */ +package org.apache.blur.manager.command; + +import java.io.IOException; + +import org.apache.lucene.index.IndexWriter; +import org.apache.lucene.search.IndexSearcher; + +public interface IndexReadWriteCommand<T> { + + public abstract T execute(Args args, IndexSearcher searcher, IndexWriter writer) throws IOException; + +} http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/42a77a51/blur-core/src/main/java/org/apache/blur/manager/command/ShardCommandManager.java ---------------------------------------------------------------------- diff --git a/blur-core/src/main/java/org/apache/blur/manager/command/ShardCommandManager.java b/blur-core/src/main/java/org/apache/blur/manager/command/ShardCommandManager.java index 3ba1b32..ad232dc 100644 --- a/blur-core/src/main/java/org/apache/blur/manager/command/ShardCommandManager.java +++ b/blur-core/src/main/java/org/apache/blur/manager/command/ShardCommandManager.java @@ -32,10 +32,7 @@ import org.apache.blur.concurrent.Executors; import org.apache.blur.manager.IndexServer; import org.apache.blur.manager.command.primitive.DocumentCount; import org.apache.blur.manager.command.primitive.DocumentCountAggregator; -import org.apache.blur.manager.command.primitive.PrimitiveCommand; -import org.apache.blur.manager.command.primitive.PrimitiveCommandAggregator; -import org.apache.blur.manager.command.primitive.ReadCommand; -import org.apache.blur.manager.command.primitive.ReadWriteCommand; +import org.apache.blur.manager.command.primitive.BaseCommand; import org.apache.blur.manager.writer.BlurIndex; import org.apache.blur.server.IndexSearcherClosable; @@ -43,7 +40,7 @@ public class ShardCommandManager implements Closeable { private final IndexServer _indexServer; private final ExecutorService _executorService; - private final Map<String, PrimitiveCommand> _command = new ConcurrentHashMap<String, PrimitiveCommand>(); + private final Map<String, BaseCommand> _command = new ConcurrentHashMap<String, BaseCommand>(); public ShardCommandManager(IndexServer indexServer, int threadCount) throws IOException { register(DocumentCount.class); @@ -52,9 +49,9 @@ public class ShardCommandManager implements Closeable { _executorService = Executors.newThreadPool("command-", threadCount); } - private void register(Class<? extends PrimitiveCommand> commandClass) throws IOException { + private void register(Class<? extends BaseCommand> commandClass) throws IOException { try { - PrimitiveCommand command = commandClass.newInstance(); + BaseCommand command = commandClass.newInstance(); _command.put(command.getName(), command); } catch (InstantiationException e) { throw new IOException(e); @@ -64,22 +61,22 @@ public class ShardCommandManager implements Closeable { } public Response execute(String table, String commandName, Args args) throws IOException { - PrimitiveCommand command = getCommandObject(commandName); + BaseCommand command = getCommandObject(commandName); if (command == null) { throw new IOException("Command with name [" + commandName + "] not found."); } - if (command instanceof ReadCommand) { - return toResponse(executeReadCommand((ReadCommand<?>) command, table, args), command); - } else if (command instanceof ReadWriteCommand) { - return toResponse(executeReadWriteCommand((ReadWriteCommand<?>) command, table, args), command); + if (command instanceof IndexReadCommand) { + return toResponse(executeReadCommand(command, table, args), command); + } else if (command instanceof IndexReadWriteCommand) { + return toResponse(executeReadWriteCommand((IndexReadWriteCommand<?>) command, table, args), command); } throw new IOException("Command type of [" + command.getClass() + "] not supported."); } @SuppressWarnings("unchecked") - private Response toResponse(Map<String, Object> results, PrimitiveCommand command) throws IOException { - if (command instanceof PrimitiveCommandAggregator) { - PrimitiveCommandAggregator<Object, Object> primitiveCommandAggregator = (PrimitiveCommandAggregator<Object, Object>) command; + private Response toResponse(Map<String, Object> results, BaseCommand command) throws IOException { + if (command instanceof CommandAggregator) { + CommandAggregator<Object, Object> primitiveCommandAggregator = (CommandAggregator<Object, Object>) command; Iterator<Entry<String, Object>> iterator = results.entrySet().iterator(); Object object = primitiveCommandAggregator.aggregate(iterator); return Response.createNewAggregateResponse(object); @@ -87,18 +84,18 @@ public class ShardCommandManager implements Closeable { return Response.createNewResponse(results); } - private Map<String, Object> executeReadWriteCommand(ReadWriteCommand<?> command, String table, Args args) { + private Map<String, Object> executeReadWriteCommand(IndexReadWriteCommand<?> command, String table, Args args) { return null; } - private Map<String, Object> executeReadCommand(ReadCommand<?> command, String table, final Args args) + private Map<String, Object> executeReadCommand(BaseCommand command, String table, final Args args) throws IOException { Map<String, BlurIndex> indexes = _indexServer.getIndexes(table); Map<String, Future<?>> futureMap = new HashMap<String, Future<?>>(); for (Entry<String, BlurIndex> e : indexes.entrySet()) { String shardId = e.getKey(); final BlurIndex blurIndex = e.getValue(); - final ReadCommand<?> readCommand = command.clone(); + final IndexReadCommand<?> readCommand = (IndexReadCommand<?>) command.clone(); Future<Object> future = _executorService.submit(new Callable<Object>() { @Override public Object call() throws Exception { @@ -128,7 +125,7 @@ public class ShardCommandManager implements Closeable { return resultMap; } - private PrimitiveCommand getCommandObject(String commandName) { + private BaseCommand getCommandObject(String commandName) { return _command.get(commandName); } http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/42a77a51/blur-core/src/main/java/org/apache/blur/manager/command/cluster/DocumentCount.java ---------------------------------------------------------------------- diff --git a/blur-core/src/main/java/org/apache/blur/manager/command/cluster/DocumentCount.java b/blur-core/src/main/java/org/apache/blur/manager/command/cluster/DocumentCount.java deleted file mode 100644 index c5fc7d6..0000000 --- a/blur-core/src/main/java/org/apache/blur/manager/command/cluster/DocumentCount.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.apache.blur.manager.command.cluster; - -import java.util.Map; - -import org.apache.blur.manager.command.Args; -import org.apache.blur.manager.command.ClusterCommand; -import org.apache.blur.manager.command.CommandContext; -import org.apache.blur.manager.command.Response; - -/** - * 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. - */ - -@SuppressWarnings("serial") -public class DocumentCount extends ClusterCommand { - - @Override - public String getName() { - return "docCount"; - } - - @Override - public Response execute(Args args, CommandContext context) { - // where the key is the shard in the table - Map<String, Object> results = context.execute(args, "docCount"); - return Response.createNewResponse(results); - } - -} http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/42a77a51/blur-core/src/main/java/org/apache/blur/manager/command/cluster/DocumentCountAggregator.java ---------------------------------------------------------------------- diff --git a/blur-core/src/main/java/org/apache/blur/manager/command/cluster/DocumentCountAggregator.java b/blur-core/src/main/java/org/apache/blur/manager/command/cluster/DocumentCountAggregator.java deleted file mode 100644 index a7789dc..0000000 --- a/blur-core/src/main/java/org/apache/blur/manager/command/cluster/DocumentCountAggregator.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.apache.blur.manager.command.cluster; - -import java.util.Map; -import java.util.Map.Entry; - -import org.apache.blur.manager.command.Args; -import org.apache.blur.manager.command.ClusterCommand; -import org.apache.blur.manager.command.CommandContext; -import org.apache.blur.manager.command.Response; - -/** - * 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. - */ - -@SuppressWarnings("serial") -public class DocumentCountAggregator extends ClusterCommand { - - @Override - public String getName() { - return "docCountAggregate"; - } - - @Override - public Response execute(Args args, CommandContext context) { - // where the key is the server hostname - Map<String, Long> results = context.execute(args, "docCountAggregate"); - long total = 0; - for (Entry<String, Long> e : results.entrySet()) { - total += e.getValue(); - } - return Response.createNewAggregateResponse(total); - } - -} http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/42a77a51/blur-core/src/main/java/org/apache/blur/manager/command/primitive/BaseCommand.java ---------------------------------------------------------------------- diff --git a/blur-core/src/main/java/org/apache/blur/manager/command/primitive/BaseCommand.java b/blur-core/src/main/java/org/apache/blur/manager/command/primitive/BaseCommand.java new file mode 100644 index 0000000..3cb19ab --- /dev/null +++ b/blur-core/src/main/java/org/apache/blur/manager/command/primitive/BaseCommand.java @@ -0,0 +1,35 @@ +/** + * 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. + */ +package org.apache.blur.manager.command.primitive; + +import java.io.Serializable; + +@SuppressWarnings("serial") +public abstract class BaseCommand implements Serializable, Cloneable { + + public abstract String getName(); + + @Override + public BaseCommand clone() { + try { + return (BaseCommand) super.clone(); + } catch (CloneNotSupportedException e) { + throw new RuntimeException(e); + } + } + +} http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/42a77a51/blur-core/src/main/java/org/apache/blur/manager/command/primitive/DocumentCount.java ---------------------------------------------------------------------- diff --git a/blur-core/src/main/java/org/apache/blur/manager/command/primitive/DocumentCount.java b/blur-core/src/main/java/org/apache/blur/manager/command/primitive/DocumentCount.java index 4a6de04..5bb37cf 100644 --- a/blur-core/src/main/java/org/apache/blur/manager/command/primitive/DocumentCount.java +++ b/blur-core/src/main/java/org/apache/blur/manager/command/primitive/DocumentCount.java @@ -19,14 +19,17 @@ package org.apache.blur.manager.command.primitive; import java.io.IOException; import org.apache.blur.manager.command.Args; +import org.apache.blur.manager.command.IndexReadCommand; import org.apache.lucene.search.IndexSearcher; @SuppressWarnings("serial") -public class DocumentCount extends ReadCommand<Integer> { +public class DocumentCount extends BaseCommand implements IndexReadCommand<Integer> { + + private static final String DOC_COUNT = "docCount"; @Override public String getName() { - return "docCount"; + return DOC_COUNT; } @Override http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/42a77a51/blur-core/src/main/java/org/apache/blur/manager/command/primitive/DocumentCountAggregator.java ---------------------------------------------------------------------- diff --git a/blur-core/src/main/java/org/apache/blur/manager/command/primitive/DocumentCountAggregator.java b/blur-core/src/main/java/org/apache/blur/manager/command/primitive/DocumentCountAggregator.java index 9187421..f876cd1 100644 --- a/blur-core/src/main/java/org/apache/blur/manager/command/primitive/DocumentCountAggregator.java +++ b/blur-core/src/main/java/org/apache/blur/manager/command/primitive/DocumentCountAggregator.java @@ -18,14 +18,23 @@ package org.apache.blur.manager.command.primitive; import java.io.IOException; import java.util.Iterator; +import java.util.Map; import java.util.Map.Entry; +import org.apache.blur.manager.command.Args; +import org.apache.blur.manager.command.ClusterCommand; +import org.apache.blur.manager.command.CommandAggregator; +import org.apache.blur.manager.command.CommandContext; + @SuppressWarnings("serial") -public class DocumentCountAggregator extends DocumentCount implements PrimitiveCommandAggregator<Integer, Long> { +public class DocumentCountAggregator extends DocumentCount implements ClusterCommand<Long>, + CommandAggregator<Integer, Long> { + + private static final String DOC_COUNT_AGGREGATE = "docCountAggregate"; @Override public String getName() { - return "docCountAggregate"; + return DOC_COUNT_AGGREGATE; } @Override @@ -37,4 +46,15 @@ public class DocumentCountAggregator extends DocumentCount implements PrimitiveC return total; } + @Override + public Long clusterExecute(Args args, CommandContext context) { + // where the key is the server hostname + Map<String, Long> results = context.execute(args, DOC_COUNT_AGGREGATE); + long total = 0; + for (Entry<String, Long> e : results.entrySet()) { + total += e.getValue(); + } + return total; + } + } http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/42a77a51/blur-core/src/main/java/org/apache/blur/manager/command/primitive/PrimitiveCommand.java ---------------------------------------------------------------------- diff --git a/blur-core/src/main/java/org/apache/blur/manager/command/primitive/PrimitiveCommand.java b/blur-core/src/main/java/org/apache/blur/manager/command/primitive/PrimitiveCommand.java deleted file mode 100644 index b9c5757..0000000 --- a/blur-core/src/main/java/org/apache/blur/manager/command/primitive/PrimitiveCommand.java +++ /dev/null @@ -1,35 +0,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. - */ -package org.apache.blur.manager.command.primitive; - -import java.io.Serializable; - -@SuppressWarnings("serial") -public abstract class PrimitiveCommand implements Serializable, Cloneable { - - public abstract String getName(); - - @Override - public PrimitiveCommand clone() { - try { - return (PrimitiveCommand) super.clone(); - } catch (CloneNotSupportedException e) { - throw new RuntimeException(e); - } - } - -} http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/42a77a51/blur-core/src/main/java/org/apache/blur/manager/command/primitive/PrimitiveCommandAggregator.java ---------------------------------------------------------------------- diff --git a/blur-core/src/main/java/org/apache/blur/manager/command/primitive/PrimitiveCommandAggregator.java b/blur-core/src/main/java/org/apache/blur/manager/command/primitive/PrimitiveCommandAggregator.java deleted file mode 100644 index 3182cc8..0000000 --- a/blur-core/src/main/java/org/apache/blur/manager/command/primitive/PrimitiveCommandAggregator.java +++ /dev/null @@ -1,27 +0,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. - */ -package org.apache.blur.manager.command.primitive; - -import java.io.IOException; -import java.util.Iterator; -import java.util.Map.Entry; - -public interface PrimitiveCommandAggregator<IN, OUT> { - - OUT aggregate(Iterator<Entry<String, IN>> it) throws IOException; - -} http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/42a77a51/blur-core/src/main/java/org/apache/blur/manager/command/primitive/ReadCommand.java ---------------------------------------------------------------------- diff --git a/blur-core/src/main/java/org/apache/blur/manager/command/primitive/ReadCommand.java b/blur-core/src/main/java/org/apache/blur/manager/command/primitive/ReadCommand.java deleted file mode 100644 index 6f436e5..0000000 --- a/blur-core/src/main/java/org/apache/blur/manager/command/primitive/ReadCommand.java +++ /dev/null @@ -1,37 +0,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. - */ -package org.apache.blur.manager.command.primitive; - -import java.io.IOException; - -import org.apache.blur.manager.command.Args; -import org.apache.lucene.search.IndexSearcher; - -@SuppressWarnings("serial") -public abstract class ReadCommand<T> extends PrimitiveCommand { - - @SuppressWarnings("unchecked") - @Override - public ReadCommand<T> clone() { - return (ReadCommand<T>) super.clone(); - } - - public abstract String getName(); - - public abstract T execute(Args args, IndexSearcher searcher) throws IOException; - -} http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/42a77a51/blur-core/src/main/java/org/apache/blur/manager/command/primitive/ReadWriteCommand.java ---------------------------------------------------------------------- diff --git a/blur-core/src/main/java/org/apache/blur/manager/command/primitive/ReadWriteCommand.java b/blur-core/src/main/java/org/apache/blur/manager/command/primitive/ReadWriteCommand.java deleted file mode 100644 index 129fc94..0000000 --- a/blur-core/src/main/java/org/apache/blur/manager/command/primitive/ReadWriteCommand.java +++ /dev/null @@ -1,38 +0,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. - */ -package org.apache.blur.manager.command.primitive; - -import java.io.IOException; - -import org.apache.blur.manager.command.Args; -import org.apache.lucene.index.IndexWriter; -import org.apache.lucene.search.IndexSearcher; - -@SuppressWarnings("serial") -public abstract class ReadWriteCommand<T> extends PrimitiveCommand { - - @SuppressWarnings("unchecked") - @Override - public ReadWriteCommand<T> clone() { - return (ReadWriteCommand<T>) super.clone(); - } - - public abstract String getName(); - - public abstract T execute(Args args, IndexSearcher searcher, IndexWriter writer) throws IOException; - -}
