helix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vinay...@apache.org
Subject git commit: Added NodeInstance API
Date Mon, 22 Jul 2013 22:41:29 GMT
Updated Branches:
  refs/heads/helix_api_refactoring b50ddcdca -> 8fc5650bd


Added NodeInstance API


Project: http://git-wip-us.apache.org/repos/asf/incubator-helix/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-helix/commit/8fc5650b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-helix/tree/8fc5650b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-helix/diff/8fc5650b

Branch: refs/heads/helix_api_refactoring
Commit: 8fc5650bd1878c7784400cbfb3fa2847e40da9eb
Parents: b50ddcd
Author: Vinayak Borkar <vinayakb@netbook.local>
Authored: Mon Jul 22 15:41:25 2013 -0700
Committer: Vinayak Borkar <vinayakb@netbook.local>
Committed: Mon Jul 22 15:41:25 2013 -0700

----------------------------------------------------------------------
 .../apache/helix/api/model/NodeInstance.java    | 37 ++++++++++++++++++++
 .../helix/api/model/NodeInstanceState.java      | 10 ++++++
 .../org/apache/helix/api/model/PartitionId.java | 20 +++++++++++
 .../helix/api/model/PropertyLifetime.java       |  6 ++++
 .../org/apache/helix/api/model/ResourceId.java  | 13 +++++++
 5 files changed, 86 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/8fc5650b/helix-api/src/main/java/org/apache/helix/api/model/NodeInstance.java
----------------------------------------------------------------------
diff --git a/helix-api/src/main/java/org/apache/helix/api/model/NodeInstance.java b/helix-api/src/main/java/org/apache/helix/api/model/NodeInstance.java
new file mode 100644
index 0000000..097bfb9
--- /dev/null
+++ b/helix-api/src/main/java/org/apache/helix/api/model/NodeInstance.java
@@ -0,0 +1,37 @@
+package org.apache.helix.api.model;
+
+import java.util.List;
+
+public interface NodeInstance {
+    public interface Builder {
+        public void setName(String name);
+
+        public void setEnabled(boolean enabled);
+
+        public <T> void setProperty(PropertyLifetime lifetime, String name, T value);
+
+        public void setHost(String host);
+
+        public void setPort(int port);
+
+        public void setTagList(List<String> tagList);
+
+        public void setBlacklistedPartitions(List<PartitionId> partitionIds);
+    }
+
+    public String getName();
+
+    public NodeInstanceState getNodeInstanceState();
+
+    public boolean isEnabled();
+
+    public <T> T getProperty(String name);
+
+    public String getHost();
+
+    public int getPort();
+
+    public List<String> getTagList();
+
+    public List<PartitionId> getBlacklistedPartitions();
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/8fc5650b/helix-api/src/main/java/org/apache/helix/api/model/NodeInstanceState.java
----------------------------------------------------------------------
diff --git a/helix-api/src/main/java/org/apache/helix/api/model/NodeInstanceState.java b/helix-api/src/main/java/org/apache/helix/api/model/NodeInstanceState.java
new file mode 100644
index 0000000..f0852d2
--- /dev/null
+++ b/helix-api/src/main/java/org/apache/helix/api/model/NodeInstanceState.java
@@ -0,0 +1,10 @@
+package org.apache.helix.api.model;
+
+public enum NodeInstanceState {
+    NEW,
+    STARTING,
+    RUNNING,
+    STOPPING,
+    TERMINATED,
+    FAILED
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/8fc5650b/helix-api/src/main/java/org/apache/helix/api/model/PartitionId.java
----------------------------------------------------------------------
diff --git a/helix-api/src/main/java/org/apache/helix/api/model/PartitionId.java b/helix-api/src/main/java/org/apache/helix/api/model/PartitionId.java
new file mode 100644
index 0000000..9fefe5d
--- /dev/null
+++ b/helix-api/src/main/java/org/apache/helix/api/model/PartitionId.java
@@ -0,0 +1,20 @@
+package org.apache.helix.api.model;
+
+public final class PartitionId {
+    private final ResourceId resourceId;
+
+    private final String partitionName;
+
+    public PartitionId(ResourceId resourceId, String partitionName) {
+        this.resourceId = resourceId;
+        this.partitionName = partitionName;
+    }
+
+    public ResourceId getResourceId() {
+        return resourceId;
+    }
+
+    public String getPartitionName() {
+        return partitionName;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/8fc5650b/helix-api/src/main/java/org/apache/helix/api/model/PropertyLifetime.java
----------------------------------------------------------------------
diff --git a/helix-api/src/main/java/org/apache/helix/api/model/PropertyLifetime.java b/helix-api/src/main/java/org/apache/helix/api/model/PropertyLifetime.java
new file mode 100644
index 0000000..008979e
--- /dev/null
+++ b/helix-api/src/main/java/org/apache/helix/api/model/PropertyLifetime.java
@@ -0,0 +1,6 @@
+package org.apache.helix.api.model;
+
+public enum PropertyLifetime {
+    SESSION,
+    PERSISTENT
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/8fc5650b/helix-api/src/main/java/org/apache/helix/api/model/ResourceId.java
----------------------------------------------------------------------
diff --git a/helix-api/src/main/java/org/apache/helix/api/model/ResourceId.java b/helix-api/src/main/java/org/apache/helix/api/model/ResourceId.java
new file mode 100644
index 0000000..ed35725
--- /dev/null
+++ b/helix-api/src/main/java/org/apache/helix/api/model/ResourceId.java
@@ -0,0 +1,13 @@
+package org.apache.helix.api.model;
+
+public final class ResourceId {
+    private final String resourceName;
+
+    public ResourceId(String resourceName) {
+        this.resourceName = resourceName;
+    }
+
+    public String getResourceName() {
+        return resourceName;
+    }
+}
\ No newline at end of file


Mime
View raw message