You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ed...@apache.org on 2012/08/25 03:25:01 UTC

git commit: add storage interface

Updated Branches:
  refs/heads/javelin 07d00ebbf -> e07f8449f


add storage interface


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

Branch: refs/heads/javelin
Commit: e07f8449f430a1bcdf0449a582083f218c0c7bcd
Parents: 07d00eb
Author: Edison Su <su...@gmail.com>
Authored: Fri Aug 24 18:24:26 2012 -0700
Committer: Edison Su <su...@gmail.com>
Committed: Fri Aug 24 18:24:26 2012 -0700

----------------------------------------------------------------------
 framework/ipc/pom.xml                              |    6 ++
 platform/api/pom.xml                               |   13 ++++
 .../api/storage/DataMigrationSubSystem.java        |   23 +++++++
 .../platform/subsystem/api/storage/DataObject.java |   42 +++++++++++++
 .../platform/subsystem/api/storage/DataStore.java  |   47 +++++++++++++++
 .../subsystem/api/storage/DataStoreDriver.java     |   28 +++++++++
 .../api/storage/DistributedFileSystem.java         |   23 +++++++
 .../platform/subsystem/api/storage/FileSystem.java |   31 ++++++++++
 .../platform/subsystem/api/storage/Snapshot.java   |   23 +++++++
 .../subsystem/api/storage/StorageSubSystem.java    |   13 ++++
 .../platform/subsystem/api/storage/Template.java   |   23 +++++++
 .../platform/subsystem/api/storage/Volume.java     |   22 +++++++
 platform/compute/pom.xml                           |   13 ++++
 13 files changed, 307 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e07f8449/framework/ipc/pom.xml
----------------------------------------------------------------------
diff --git a/framework/ipc/pom.xml b/framework/ipc/pom.xml
new file mode 100644
index 0000000..c376acd
--- /dev/null
+++ b/framework/ipc/pom.xml
@@ -0,0 +1,6 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>cloudstack</groupId>
+  <artifactId>cloud-framework-ipc</artifactId>
+  <version>0.0.1-SNAPSHOT</version>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e07f8449/platform/api/pom.xml
----------------------------------------------------------------------
diff --git a/platform/api/pom.xml b/platform/api/pom.xml
new file mode 100644
index 0000000..9d59e0b
--- /dev/null
+++ b/platform/api/pom.xml
@@ -0,0 +1,13 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>cloudstack</groupId>
+  <artifactId>cloud-platform-api</artifactId>
+  <version>0.0.1-SNAPSHOT</version>
+  <dependencies>
+  	<dependency>
+  		<groupId>com.cloud</groupId>
+  		<artifactId>cloud-api</artifactId>
+  		<version>4.0.0-SNAPSHOT</version>
+  	</dependency>
+  </dependencies>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e07f8449/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/DataMigrationSubSystem.java
----------------------------------------------------------------------
diff --git a/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/DataMigrationSubSystem.java b/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/DataMigrationSubSystem.java
new file mode 100755
index 0000000..30185b7
--- /dev/null
+++ b/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/DataMigrationSubSystem.java
@@ -0,0 +1,23 @@
+/*
+ * 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.cloudstack.platform.subsystem.api.storage;
+
+public interface DataMigrationSubSystem {
+    void migrate(String volume, String storagePool, String reservationId);
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e07f8449/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/DataObject.java
----------------------------------------------------------------------
diff --git a/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/DataObject.java b/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/DataObject.java
new file mode 100644
index 0000000..c861bc4
--- /dev/null
+++ b/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/DataObject.java
@@ -0,0 +1,42 @@
+/*
+ * 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.cloudstack.platform.subsystem.api.storage;
+
+import java.util.List;
+
+import org.apache.cloudstack.platform.subsystem.api.storage.DataStore.DataStoreRef;
+
+/*
+ * Logic entity
+ */
+public interface DataObject {
+	String getURI();
+	String getUUID();
+	DataStoreRef getStoreRef();
+	long getSize();
+	//volume/snapshot/template
+	String getType();
+	//db id
+	Long getId();
+	DataObject getParent();
+	void setParent(DataObject obj);
+	List<DataObject> getChidren();
+	boolean lock();
+	boolean unlock();
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e07f8449/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/DataStore.java
----------------------------------------------------------------------
diff --git a/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/DataStore.java b/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/DataStore.java
new file mode 100644
index 0000000..3415a71
--- /dev/null
+++ b/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/DataStore.java
@@ -0,0 +1,47 @@
+/*
+ * 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.cloudstack.platform.subsystem.api.storage;
+
+public interface DataStore {
+	public class DataStoreRef {
+		
+	}
+	
+	public class DataStoreDriverRef {
+		
+	}
+	
+	public enum StoreType {
+		Primary,
+		Backup;
+	}
+	public class StoreScope {
+		public long zoneId;
+		private long clusterId;
+		private long hostId;
+	}
+	
+	String getURI();
+	String getUUID();
+	StoreType getType();
+	StoreScope getScope();
+	Long getId();
+	DataStoreDriverRef getDataStoreDriver();
+	FileSystem getFileSystem();
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e07f8449/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/DataStoreDriver.java
----------------------------------------------------------------------
diff --git a/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/DataStoreDriver.java b/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/DataStoreDriver.java
new file mode 100644
index 0000000..f8987f7
--- /dev/null
+++ b/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/DataStoreDriver.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.cloudstack.platform.subsystem.api.storage;
+
+public interface DataStoreDriver {
+	String getDriverType();
+	DataObject create(DataObject obj);
+	DataObject copy(DataObject src, DataStore dest);
+	DataObject copy(DataObject src, DataObject dest);
+	DataObject move(DataObject src, DataObject dest);
+	boolean delete(DataObject obj);
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e07f8449/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/DistributedFileSystem.java
----------------------------------------------------------------------
diff --git a/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/DistributedFileSystem.java b/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/DistributedFileSystem.java
new file mode 100644
index 0000000..84eb8ad
--- /dev/null
+++ b/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/DistributedFileSystem.java
@@ -0,0 +1,23 @@
+/*
+ * 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.cloudstack.platform.subsystem.api.storage;
+
+public interface DistributedFileSystem {
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e07f8449/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/FileSystem.java
----------------------------------------------------------------------
diff --git a/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/FileSystem.java b/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/FileSystem.java
new file mode 100644
index 0000000..b0fba44
--- /dev/null
+++ b/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/FileSystem.java
@@ -0,0 +1,31 @@
+/*
+ * 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.cloudstack.platform.subsystem.api.storage;
+
+public interface FileSystem {
+	DataObject create(DataObject obj);
+	DataObject copy(DataObject Obj, DataStore destStore);
+	DataObject copy(DataObject obj, DataObject destObj);
+	DataObject move(DataObject srcObj, DataObject destObj);
+	boolean delete(DataObject obj);
+	long getStats(DataObject obj);
+	String getFileType();
+	boolean isWritable(DataObject obj);
+	boolean contains(DataObject obj);
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e07f8449/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/Snapshot.java
----------------------------------------------------------------------
diff --git a/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/Snapshot.java b/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/Snapshot.java
new file mode 100644
index 0000000..5702e4c
--- /dev/null
+++ b/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/Snapshot.java
@@ -0,0 +1,23 @@
+/*
+ * 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.cloudstack.platform.subsystem.api.storage;
+
+public interface Snapshot extends DataObject {
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e07f8449/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/StorageSubSystem.java
----------------------------------------------------------------------
diff --git a/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/StorageSubSystem.java b/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/StorageSubSystem.java
new file mode 100755
index 0000000..e12ff79
--- /dev/null
+++ b/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/StorageSubSystem.java
@@ -0,0 +1,13 @@
+package org.apache.cloudstack.platform.subsystem.api.storage;
+
+import java.net.URI;
+
+import com.cloud.org.Grouping;
+
+public interface StorageSubSystem {
+    String getType();
+    Class<? extends Grouping> getScope();
+
+    URI grantAccess(String vol, String reservationId);
+    URI RemoveAccess(String vol, String reservationId);
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e07f8449/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/Template.java
----------------------------------------------------------------------
diff --git a/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/Template.java b/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/Template.java
new file mode 100644
index 0000000..efa7538
--- /dev/null
+++ b/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/Template.java
@@ -0,0 +1,23 @@
+/*
+ * 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.cloudstack.platform.subsystem.api.storage;
+
+public interface Template extends DataObject {
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e07f8449/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/Volume.java
----------------------------------------------------------------------
diff --git a/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/Volume.java b/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/Volume.java
new file mode 100644
index 0000000..dc72d8f
--- /dev/null
+++ b/platform/api/src/main/java/org/apache/cloudstack/platform/subsystem/api/storage/Volume.java
@@ -0,0 +1,22 @@
+/*
+ * 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.cloudstack.platform.subsystem.api.storage;
+
+public interface Volume extends DataObject {
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e07f8449/platform/compute/pom.xml
----------------------------------------------------------------------
diff --git a/platform/compute/pom.xml b/platform/compute/pom.xml
new file mode 100644
index 0000000..23bd8e7
--- /dev/null
+++ b/platform/compute/pom.xml
@@ -0,0 +1,13 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>cloudstack</groupId>
+  <artifactId>cloud-platform-compute</artifactId>
+  <version>0.0.1-SNAPSHOT</version>
+  <dependencies>
+  	<dependency>
+  		  <groupId>cloudstack</groupId>
+  		  <artifactId>cloud-framework-ipc</artifactId>
+          <version>0.0.1-SNAPSHOT</version>
+  	</dependency>
+  </dependencies>
+</project>
\ No newline at end of file