lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r1210027 - in /lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update: AddUpdateCommand.java CommitUpdateCommand.java DeleteUpdateCommand.java MergeIndexesCommand.java RollbackUpdateCommand.java UpdateCommand.java
Date Sat, 03 Dec 2011 23:02:49 GMT
Author: yonik
Date: Sat Dec  3 23:02:48 2011
New Revision: 1210027

URL: http://svn.apache.org/viewvc?rev=1210027&view=rev
Log:
minor update command cleanups

Modified:
    lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/AddUpdateCommand.java
    lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/CommitUpdateCommand.java
    lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/DeleteUpdateCommand.java
    lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/MergeIndexesCommand.java
    lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/RollbackUpdateCommand.java
    lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/UpdateCommand.java

Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/AddUpdateCommand.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/AddUpdateCommand.java?rev=1210027&r1=1210026&r2=1210027&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/AddUpdateCommand.java
(original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/AddUpdateCommand.java
Sat Dec  3 23:02:48 2011
@@ -45,9 +45,14 @@ public class AddUpdateCommand extends Up
    public int commitWithin = -1;
    
    public AddUpdateCommand(SolrQueryRequest req) {
-     super("add", req);
+     super(req);
    }
 
+  @Override
+  public String name() {
+    return "add";
+  }
+
    /** Reset state to reuse this object with a different document in the same request */
    public void clear() {
      solrDoc = null;

Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/CommitUpdateCommand.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/CommitUpdateCommand.java?rev=1210027&r1=1210026&r2=1210027&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/CommitUpdateCommand.java
(original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/CommitUpdateCommand.java
Sat Dec  3 23:02:48 2011
@@ -36,15 +36,21 @@ public class CommitUpdateCommand extends
   public int maxOptimizeSegments = 1;
 
   public CommitUpdateCommand(SolrQueryRequest req, boolean optimize) {
-    super("commit", req);
+    super(req);
     this.optimize=optimize;
   }
+
+  @Override
+  public String name() {
+    return "commit";
+  }
+
   @Override
   public String toString() {
-    return "commit(optimize="+optimize
+    return super.toString() + ",optimize="+optimize
             +",waitSearcher="+waitSearcher
             +",expungeDeletes="+expungeDeletes
             +",softCommit="+softCommit
-            +')';
+            +'}';
   }
 }

Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/DeleteUpdateCommand.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/DeleteUpdateCommand.java?rev=1210027&r1=1210026&r2=1210027&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/DeleteUpdateCommand.java
(original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/DeleteUpdateCommand.java
Sat Dec  3 23:02:48 2011
@@ -34,7 +34,12 @@ public class DeleteUpdateCommand extends
 
 
   public DeleteUpdateCommand(SolrQueryRequest req) {
-    super("delete", req);
+    super(req);
+  }
+
+  @Override
+  public String name() {
+    return "delete";
   }
 
   public boolean isDeleteById() {

Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/MergeIndexesCommand.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/MergeIndexesCommand.java?rev=1210027&r1=1210026&r2=1210027&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/MergeIndexesCommand.java
(original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/MergeIndexesCommand.java
Sat Dec  3 23:02:48 2011
@@ -31,20 +31,25 @@ public class MergeIndexesCommand extends
   public IndexReader[] readers;
 
   public MergeIndexesCommand(IndexReader[] readers, SolrQueryRequest req) {
-    super("mergeIndexes", req);
+    super(req);
     this.readers = readers;
   }
 
   @Override
+  public String name() {
+    return "mergeIndexes";
+  }
+
+  @Override
   public String toString() {
-    StringBuilder sb = new StringBuilder(commandName);
-    sb.append(':');
+    StringBuilder sb = new StringBuilder(super.toString());
     if (readers != null && readers.length > 0) {
       sb.append(readers[0].directory());
       for (int i = 1; i < readers.length; i++) {
         sb.append(",").append(readers[i].directory());
       }
     }
+    sb.append('}');
     return sb.toString();
   }
 }

Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/RollbackUpdateCommand.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/RollbackUpdateCommand.java?rev=1210027&r1=1210026&r2=1210027&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/RollbackUpdateCommand.java
(original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/RollbackUpdateCommand.java
Sat Dec  3 23:02:48 2011
@@ -26,7 +26,16 @@ import org.apache.solr.request.SolrQuery
 public class RollbackUpdateCommand extends UpdateCommand {
 
   public RollbackUpdateCommand(SolrQueryRequest req) {
-    super("rollback", req);
+    super(req);
   }
 
+  @Override
+  public String name() {
+    return "rollback";
+  }
+
+  @Override
+  public String toString() {
+    return super.toString() + '}';
+  }
 }

Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/UpdateCommand.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/UpdateCommand.java?rev=1210027&r1=1210026&r2=1210027&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/UpdateCommand.java
(original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/UpdateCommand.java
Sat Dec  3 23:02:48 2011
@@ -25,9 +25,8 @@ import org.apache.solr.request.SolrQuery
  *
  *
  */
-public class UpdateCommand implements Cloneable {
+public abstract class UpdateCommand implements Cloneable {
   protected SolrQueryRequest req;
-  protected final String commandName;
   protected long version;
   protected int flags;
 
@@ -35,14 +34,15 @@ public class UpdateCommand implements Cl
   public static int REPLAY    = 0x00000002; // update command is from replaying a log.
   public static int IGNORE_AUTOCOMMIT = 0x00000002; // this update should not count toward
triggering of autocommits.
 
-  public UpdateCommand(String commandName, SolrQueryRequest req) {
+  public UpdateCommand(SolrQueryRequest req) {
     this.req = req;
-    this.commandName = commandName;
   }
 
+  public abstract String name();
+
   @Override
   public String toString() {
-    return commandName + ":{flags="+flags+", version="+version;
+    return name() + "{flags="+flags+",version="+version;
   }
 
   public long getVersion() {



Mime
View raw message