You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oodt.apache.org by ma...@apache.org on 2017/10/15 20:53:57 UTC
[5/8] oodt git commit: - fix conflicts
- fix conflicts
Project: http://git-wip-us.apache.org/repos/asf/oodt/repo
Commit: http://git-wip-us.apache.org/repos/asf/oodt/commit/bca018f9
Tree: http://git-wip-us.apache.org/repos/asf/oodt/tree/bca018f9
Diff: http://git-wip-us.apache.org/repos/asf/oodt/diff/bca018f9
Branch: refs/heads/master
Commit: bca018f9e805cb260779e131d9492d07d5b136de
Parents: 3d40d19 287d4e8
Author: Chris Mattmann <ma...@apache.org>
Authored: Sun Oct 15 11:52:02 2017 -0700
Committer: Chris Mattmann <ma...@apache.org>
Committed: Sun Oct 15 11:52:02 2017 -0700
----------------------------------------------------------------------
resource/pom.xml | 186 +++++---
resource/src/main/avro/types/AvroJob.avsc | 17 +
resource/src/main/avro/types/AvroJobInput.avsc | 11 +
.../main/avro/types/AvroNameValueJobInput.avsc | 10 +
.../src/main/avro/types/AvroResourceNode.avsc | 11 +
.../avro/types/resource_manager_protocol.avdl | 53 +++
.../src/main/avro/types/tatchmgr_protocol.avdl | 27 ++
.../cas/resource/batchmgr/AvroRpcBatchMgr.java | 180 ++++++++
.../batchmgr/AvroRpcBatchMgrFactory.java | 32 ++
.../resource/batchmgr/AvroRpcBatchMgrProxy.java | 135 ++++++
.../cas/resource/structs/AvroTypeFactory.java | 168 ++++++++
.../cas/resource/structs/NameValueJobInput.java | 5 +-
.../resource/system/AvroRpcResourceManager.java | 425 +++++++++++++++++++
.../system/AvroRpcResourceManagerClient.java | 305 +++++++++++++
.../cas/resource/system/ResourceManager.java | 31 ++
.../resource/system/ResourceManagerClient.java | 80 ++++
.../system/XmlRpcResourceManagerClient.java | 26 +-
.../system/extern/AvroRpcBatchStub.java | 212 +++++++++
.../cas/resource/batchmgr/TestBatchMgr.java | 54 +++
.../resource/structs/TestAvroTypeFactory.java | 112 +++++
.../system/TestAvroRpcResourceManager.java | 159 +++++++
.../system/TestXmlRpcResourceManager.java | 4 +
22 files changed, 2175 insertions(+), 68 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/oodt/blob/bca018f9/resource/pom.xml
----------------------------------------------------------------------
diff --cc resource/pom.xml
index 07f4884,b91fa84..38343a5
--- a/resource/pom.xml
+++ b/resource/pom.xml
@@@ -28,65 -28,148 +28,175 @@@ the License
<description>The resource management component of a Catalog and Archive Service. This component
provides job management, and management of the underlying software system hardware
and resources, such as disk space, computational resources, and shared identity.</description>
+ <!-- All dependencies should be listed in core/pom.xml and be ordered alphabetically by package and artifact.
+ Once the dependency is in the core pom, it can then be used in other modules without the version tags.
+ For example, within core/pom.xml:
+
+ <dependency>
+ <groupId>com.amazonaws</groupId>
+ <artifactId>aws-java-sdk</artifactId>
+ <version>1.7.4</version>
+ </dependency>
+
+ Elsewhere in the platform:
+ <dependency>
+ <groupId>com.amazonaws</groupId>
+ <artifactId>aws-java-sdk</artifactId>
+ </dependency>
+
+ Where possible the same dependency version should be used across the whole platform but if required the version
+ can be overridden in a specific pom and should have a comment explaing why the version has been overridden
+ -->
+ <scm>
+ <connection>scm:svn:https://svn.apache.org/repos/asf/oodt/trunk/resource</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/oodt/trunk/resource</developerConnection>
+ <url>http://svn.apache.org/viewvc/oodt/trunk/resource</url>
+ </scm>
+ <build>
+ <plugins>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.3.2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.avro</groupId>
+ <artifactId>avro-maven-plugin</artifactId>
+ <version>1.7.7</version>
+ <configuration>
+ <stringType>String</stringType>
+ <detail>true</detail>
+ </configuration>
+ <executions>
+ <execution>
+ <id>schemas</id>
+ <configuration>
+ <imports>
+ <import>${basedir}/src/main/avro/types/AvroJob.avsc</import>
+ <import>${basedir}/src/main/avro/types/AvroNameValueJobInput.avsc</import>
+ <import>${basedir}/src/main/avro/types/AvroJobInput.avsc</import>
+ </imports>
+ </configuration>
+ <goals>
+ <goal>schema</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>protocol</id>
+ <configuration><imports>
+ <import>${basedir}/src/main/avro/types</import>
-
+ </imports>
+ </configuration>
+ <goals>
+ <goal>idl-protocol</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
-
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4</version>
+ <configuration>
+ <forkMode>pertest</forkMode>
+ <useSystemClassLoader>false</useSystemClassLoader>
+ <systemProperties>
- <property>
- <name>java.util.logging.config.file</name>
- <value>${basedir}/src/test/resources/test.logging.properties</value>
- </property>
- </systemProperties>
- <forkedProcessTimeoutInSeconds>0</forkedProcessTimeoutInSeconds>
- <redirectTestOutputToFile>true</redirectTestOutputToFile>
- <includes>
- <include>**/*Test*.java</include>
- </includes>
++ <property>
++ <name>java.util.logging.config.file</name>
++ <value>${basedir}/src/test/resources/test.logging.properties</value>
++ </property>
++ </systemProperties>
++ <environmentVariables>
++ <RESMGR_HOME>${project.basedir}</RESMGR_HOME>
++ <OODT_PROJECT>primary</OODT_PROJECT>
++ </environmentVariables>
++ <forkedProcessTimeoutInSeconds>0</forkedProcessTimeoutInSeconds>
++ <redirectTestOutputToFile>true</redirectTestOutputToFile>
++ <includes>
++ <include>**/*Test*.java</include>
++ </includes>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.2-beta-2</version>
+ <configuration>
+ <descriptors>
+ <descriptor>src/main/assembly/assembly.xml</descriptor>
+ </descriptors>
+ <archive>
+ <manifest>
+ <mainClass>org.apache.oodt.cas.resource.system.XmlRpcResourceManagerClient</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ <executions>
+ <execution>
- <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
++ <phase>package</phase>
+ </execution>
+ </executions>
- </plugin>
++ </plugin>
+ </plugins>
+ </build>
<dependencies>
++ <dependency>
++ <groupId>com.thoughtworks.xstream</groupId>
++ <artifactId>xstream</artifactId>
++ <version>1.3.1</version>
++ <exclusions>
++ <exclusion>
++ <!-- xom is an optional dependency of xstream. Its also an Apache incompatible license -->
++ <groupId>xom</groupId>
++ <artifactId>xom</artifactId>
++ </exclusion>
++ </exclusions>
++ </dependency>
+ <dependency>
+ <groupId>org.apache.avro</groupId>
+ <artifactId>avro</artifactId>
+ <version>1.7.7</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.avro</groupId>
+ <artifactId>avro-ipc</artifactId>
+ <version>1.7.7</version>
+ </dependency>
<dependency>
- <groupId>com.thoughtworks.xstream</groupId>
- <artifactId>xstream</artifactId>
- <version>1.3.1</version>
- <exclusions>
- <exclusion>
- <!-- xom is an optional dependency of xstream. Its also an Apache incompatible license -->
- <groupId>xom</groupId>
- <artifactId>xom</artifactId>
- </exclusion>
- </exclusions>
+ <groupId>org.apache.oodt</groupId>
+ <artifactId>cas-metadata</artifactId>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>org.apache.oodt</groupId>
- <artifactId>cas-cli</artifactId>
- <version>${project.parent.version}</version>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
</dependency>
<dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.0.3</version>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
</dependency>
<dependency>
- <groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- <version>3.0</version>
+ <groupId>commons-dbcp</groupId>
+ <artifactId>commons-dbcp</artifactId>
</dependency>
<dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
</dependency>
<dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- <version>1.3</version>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
</dependency>
<dependency>
- <groupId>commons-dbcp</groupId>
- <artifactId>commons-dbcp</artifactId>
- <version>1.2.1</version>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
</dependency>
<dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- <version>3.2.1</version>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
</dependency>
<dependency>
<groupId>commons-pool</groupId>
http://git-wip-us.apache.org/repos/asf/oodt/blob/bca018f9/resource/src/main/java/org/apache/oodt/cas/resource/structs/NameValueJobInput.java
----------------------------------------------------------------------
diff --cc resource/src/main/java/org/apache/oodt/cas/resource/structs/NameValueJobInput.java
index 0195c9c,c3cc6fc..a7075c6
--- a/resource/src/main/java/org/apache/oodt/cas/resource/structs/NameValueJobInput.java
+++ b/resource/src/main/java/org/apache/oodt/cas/resource/structs/NameValueJobInput.java
@@@ -19,12 -19,9 +19,11 @@@
package org.apache.oodt.cas.resource.structs;
//JDK imports
-import java.util.Hashtable;
-import java.util.Iterator;
+import java.util.concurrent.ConcurrentHashMap;
- import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
import java.util.Properties;
+import java.util.Vector;
/**
* @author mattmann
@@@ -117,18 -114,8 +116,22 @@@ public class NameValueJobInput implemen
}
}
+ @Override
+ public Map<String, Vector<String>> getMetadata() {
+ Map<String, Vector<String>> met = new HashMap<String, Vector<String>>();
+ if (props != null && props.keySet() != null && props.keySet().size() > 0){
+ for (Object key: props.values()){
+ String keyName = (String)key;
+ Vector<String> vals = new Vector<String>();
+ vals.add(props.getProperty(keyName));
+ met.put(keyName, vals);
+ }
+ }
+ return met;
+ }
++
+ public Properties getProps(){
+ return this.props;
+ }
}
http://git-wip-us.apache.org/repos/asf/oodt/blob/bca018f9/resource/src/main/java/org/apache/oodt/cas/resource/system/XmlRpcResourceManagerClient.java
----------------------------------------------------------------------
diff --cc resource/src/main/java/org/apache/oodt/cas/resource/system/XmlRpcResourceManagerClient.java
index 90911c5,9110807..1fb4f84
--- a/resource/src/main/java/org/apache/oodt/cas/resource/system/XmlRpcResourceManagerClient.java
+++ b/resource/src/main/java/org/apache/oodt/cas/resource/system/XmlRpcResourceManagerClient.java
@@@ -54,13 -56,8 +54,13 @@@ import java.util.logging.Logger
* </p>
*
*/
+@Deprecated
- public class XmlRpcResourceManagerClient {
+ public class XmlRpcResourceManagerClient implements ResourceManagerClient {
+ public static final int VAL = 20;
+ public static final int INT = 60;
+ public static final int VAL1 = 60;
+ public static final int INT1 = 60;
/* our xml rpc client */
private XmlRpcClient client = null;
http://git-wip-us.apache.org/repos/asf/oodt/blob/bca018f9/resource/src/test/java/org/apache/oodt/cas/resource/system/TestXmlRpcResourceManager.java
----------------------------------------------------------------------