curator-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From randg...@apache.org
Subject [26/26] curator git commit: Merge branch 'CURATOR-3.0' into CURATOR-215
Date Tue, 12 May 2015 15:54:13 GMT
Merge branch 'CURATOR-3.0' into CURATOR-215

Conflicts:
	curator-framework/src/main/java/org/apache/curator/framework/api/CuratorEventType.java
	curator-framework/src/main/java/org/apache/curator/framework/imps/DeleteBuilderImpl.java
	curator-framework/src/site/confluence/index.confluence


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/f7697176
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/f7697176
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/f7697176

Branch: refs/heads/CURATOR-215
Commit: f76971769ce5d999ccae7a3a6c42632298e0d75b
Parents: 5414266 fc45a4e
Author: randgalt <randgalt@apache.org>
Authored: Tue May 12 10:53:32 2015 -0500
Committer: randgalt <randgalt@apache.org>
Committed: Tue May 12 10:53:32 2015 -0500

----------------------------------------------------------------------
 .../main/java/org/apache/curator/RetryLoop.java |   3 +-
 .../curator/ensemble/EnsembleListener.java      |  24 +
 .../dynamic/DynamicEnsembleProvider.java        |  61 +++
 .../curator/framework/CuratorFramework.java     |  14 +
 .../api/AddStatConfigEnsembleable.java          |  32 ++
 .../apache/curator/framework/api/Addable.java   |  43 ++
 .../framework/api/AsyncReconfigurable.java      |  29 ++
 .../framework/api/BackgroundStatable.java       |  24 +
 .../curator/framework/api/Configurable.java     |  31 ++
 .../curator/framework/api/CuratorEventType.java |  10 +
 .../curator/framework/api/DataCallbackable.java |  32 ++
 .../curator/framework/api/Ensembleable.java     |  24 +
 .../curator/framework/api/GetConfigBuilder.java |  29 ++
 .../api/IncrementalReconfigBuilder.java         |  33 ++
 .../api/JoinAddStatConfigEnsembleable.java      |  33 ++
 .../api/JoinLeaveStatConfigEnsembleable.java    |  33 ++
 .../api/JoinStatConfigEnsembleable.java         |  32 ++
 .../framework/api/JoinStatConfigurable.java     |  30 ++
 .../apache/curator/framework/api/Joinable.java  |  43 ++
 .../api/LeaveAddStatConfigEnsembleable.java     |  32 ++
 .../api/LeaveStatConfigEnsembleable.java        |  32 ++
 .../apache/curator/framework/api/Leaveable.java |  41 ++
 .../curator/framework/api/ReconfigBuilder.java  |  28 ++
 .../framework/api/ReconfigBuilderMain.java      |  27 +
 .../framework/api/StatConfigEnsembleable.java   |  26 +
 .../curator/framework/api/StatEnsembleable.java |  26 +
 .../framework/api/SyncReconfigurable.java       |  30 ++
 .../framework/ensemble/EnsembleTracker.java     | 191 +++++++
 .../framework/imps/CreateBuilderImpl.java       |  11 +-
 .../framework/imps/CuratorFrameworkImpl.java    |  12 +
 .../framework/imps/DeleteBuilderImpl.java       | 102 ++--
 .../framework/imps/GetConfigBuilderImpl.java    | 187 +++++++
 .../framework/imps/ReconfigBuilderImpl.java     | 504 +++++++++++++++++++
 .../src/site/confluence/index.confluence        |  20 +-
 .../framework/imps/TestReconfiguration.java     | 417 +++++++++++++++
 .../org/apache/curator/test/InstanceSpec.java   |   4 +
 .../curator/test/QuorumConfigBuilder.java       |   2 +-
 .../org/apache/curator/test/TestingCluster.java |   1 +
 src/site/confluence/utilities.confluence        |   5 +
 39 files changed, 2189 insertions(+), 69 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/f7697176/curator-framework/src/main/java/org/apache/curator/framework/CuratorFramework.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/curator/blob/f7697176/curator-framework/src/main/java/org/apache/curator/framework/api/CuratorEventType.java
----------------------------------------------------------------------
diff --cc curator-framework/src/main/java/org/apache/curator/framework/api/CuratorEventType.java
index dce1f7f,50e9195..5a2dc56
--- a/curator-framework/src/main/java/org/apache/curator/framework/api/CuratorEventType.java
+++ b/curator-framework/src/main/java/org/apache/curator/framework/api/CuratorEventType.java
@@@ -69,11 -69,16 +69,21 @@@ public enum CuratorEventTyp
      SET_ACL,
  
      /**
 +     * Corresponds to {@link CuratorFramework#transaction()}
 +     */
 +    TRANSACTION,
 +
 +    /**
+      * Corresponds to {@link CuratorFramework#getConfig()}
+      */
+     GET_CONFIG,
+ 
+     /**
+      * Corresponds to {@link CuratorFramework#reconfig()}
+      */
+     RECONFIG,
+ 
+     /**
       * Corresponds to {@link Watchable#usingWatcher(Watcher)} or {@link Watchable#watched()}
       */
      WATCHED,

http://git-wip-us.apache.org/repos/asf/curator/blob/f7697176/curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/curator/blob/f7697176/curator-framework/src/main/java/org/apache/curator/framework/imps/CuratorFrameworkImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/curator/blob/f7697176/curator-framework/src/main/java/org/apache/curator/framework/imps/DeleteBuilderImpl.java
----------------------------------------------------------------------
diff --cc curator-framework/src/main/java/org/apache/curator/framework/imps/DeleteBuilderImpl.java
index 51641b8,5d8b846..f5083fb
--- a/curator-framework/src/main/java/org/apache/curator/framework/imps/DeleteBuilderImpl.java
+++ b/curator-framework/src/main/java/org/apache/curator/framework/imps/DeleteBuilderImpl.java
@@@ -54,16 -55,16 +54,16 @@@ class DeleteBuilderImpl implements Dele
          guaranteed = false;
      }
  
 -    TransactionDeleteBuilder    asTransactionDeleteBuilder(final CuratorTransactionImpl
curatorTransaction, final CuratorMultiTransactionRecord transaction)
 +    <T> TransactionDeleteBuilder<T> asTransactionDeleteBuilder(final T context,
final CuratorMultiTransactionRecord transaction)
      {
 -        return new TransactionDeleteBuilder()
 +        return new TransactionDeleteBuilder<T>()
          {
              @Override
 -            public CuratorTransactionBridge forPath(String path) throws Exception
 +            public T forPath(String path) throws Exception
              {
-                 String fixedPath = client.fixForNamespace(path);
+                 String      fixedPath = client.fixForNamespace(path);
                  transaction.add(Op.delete(fixedPath, version), OperationType.DELETE, path);
 -                return curatorTransaction;
 +                return context;
              }
  
              @Override
@@@ -141,30 -142,27 +141,30 @@@
      @Override
      public void performBackgroundOperation(final OperationAndData<String> operationAndData)
throws Exception
      {
-         final TimeTrace trace = client.getZookeeperClient().startTracer("DeleteBuilderImpl-Background");
+         final TimeTrace   trace = client.getZookeeperClient().startTracer("DeleteBuilderImpl-Background");
          client.getZooKeeper().delete
-             (
-                 operationAndData.getData(),
-                 version,
-                 new AsyncCallback.VoidCallback()
+         (
+             operationAndData.getData(),
+             version,
+             new AsyncCallback.VoidCallback()
+             {
+                 @Override
+                 public void processResult(int rc, String path, Object ctx)
                  {
-                     @Override
-                     public void processResult(int rc, String path, Object ctx)
+                     trace.commit();
 -                    if ((rc == KeeperException.Code.NOTEMPTY.intValue()) && deletingChildrenIfNeeded)
{
++                    if ( (rc == KeeperException.Code.NOTEMPTY.intValue()) && deletingChildrenIfNeeded
)
 +                    {
-                         trace.commit();
-                         if ( (rc == KeeperException.Code.NOTEMPTY.intValue()) &&
deletingChildrenIfNeeded )
-                         {
-                             backgroundDeleteChildrenThenNode(operationAndData);
-                         }
-                         else
-                         {
-                             CuratorEvent event = new CuratorEventImpl(client, CuratorEventType.DELETE,
rc, path, null, ctx, null, null, null, null, null, null);
-                             client.processBackgroundOperation(operationAndData, event);
-                         }
+                         backgroundDeleteChildrenThenNode(operationAndData);
 -                    } else {
 -                        CuratorEvent event = new CuratorEventImpl(client, CuratorEventType.DELETE,
rc, path, null, ctx, null, null, null, null, null);
 +                    }
-                 },
-                 backgrounding.getContext()
-             );
++                    else
++                    {
++                        CuratorEvent event = new CuratorEventImpl(client, CuratorEventType.DELETE,
rc, path, null, ctx, null, null, null, null, null, null);
+                         client.processBackgroundOperation(operationAndData, event);
+                     }
+                 }
+             },
+             backgrounding.getContext()
+         );
      }
  
      private void backgroundDeleteChildrenThenNode(final OperationAndData<String> mainOperationAndData)

http://git-wip-us.apache.org/repos/asf/curator/blob/f7697176/curator-framework/src/site/confluence/index.confluence
----------------------------------------------------------------------
diff --cc curator-framework/src/site/confluence/index.confluence
index 3c686db,c41b244..b065f00
--- a/curator-framework/src/site/confluence/index.confluence
+++ b/curator-framework/src/site/confluence/index.confluence
@@@ -42,8 -42,11 +42,16 @@@ h3. Method
  |getData()|Begins an operation to get a ZNode's data. Call additional methods (watch, background
or get stat) and finalize the operation by calling forPath()|
  |setData()|Begins an operation to set a ZNode's data. Call additional methods (version or
background) and finalize the operation by calling forPath()|
  |getChildren()|Begins an operation to get a ZNode's list of children ZNodes. Call additional
methods (watch, background or get stat) and finalize the operation by calling forPath()|
++<<<<<<< HEAD
 +|transactionOp()|Used to allocate operations to be used with transaction().|
 +|transaction()|Atomically submit a set of operations as a transaction.|
++=======
+ |inTransaction()|Begins an atomic ZooKeeper transaction. Combine create, setData, check,
and/or delete operations and then commit() as a unit.|
+ |getACL()|Begins an operation to return a ZNode's ACL settings. Call additional methods
and finalize the operation by calling forPath()|
+ |setACL()|Begins an operation to set a ZNode's ACL settings. Call additional methods and
finalize the operation by calling forPath()|
+ |getConfig()|Begins an operation to return the last committed configuration. Call additional
methods and finalize the operation by calling forEnsemble()|
+ |reconfig()|Begins an operation to change the configuration. Call additional methods and
finalize the operation by calling forEnsemble()|
++>>>>>>> CURATOR-3.0
  
  h3. Notifications
  Notifications for background operations and watches are published via the ClientListener
interface. You register listeners with the
@@@ -66,8 -69,9 +74,10 @@@ CuratorEvent depend on the type of even
  |SYNC|getResultCode(), getStat()|
  |GET\_ACL|getResultCode(), getACLList()|
  |SET\_ACL|getResultCode()|
 +|TRANSACTION|getResultCode(), getOpResults()|
  |WATCHED|getWatchedEvent()|
+ |GET\_CONFIG|getResultCode(), getData()|
+ |RECONFIG|getResultCode(), getData()|
  
  h2. Namespaces
  Because a ZooKeeper cluster is a shared environment, it's vital that a namespace convention
is


Mime
View raw message