You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pig.apache.org by da...@apache.org on 2011/09/14 21:03:13 UTC
svn commit: r1170769 [7/7] - in /pig/branches/branch-0.9: ./
test/e2e/harness/ test/e2e/harness/test/conf/ test/e2e/harness/test/tests/
test/e2e/pig/ test/e2e/pig/conf/ test/e2e/pig/deployers/
test/e2e/pig/drivers/ test/e2e/pig/macros/ test/e2e/pig/tes...
Modified: pig/branches/branch-0.9/test/e2e/pig/udfs/java/build.xml
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.9/test/e2e/pig/udfs/java/build.xml?rev=1170769&r1=1170768&r2=1170769&view=diff
==============================================================================
--- pig/branches/branch-0.9/test/e2e/pig/udfs/java/build.xml (original)
+++ pig/branches/branch-0.9/test/e2e/pig/udfs/java/build.xml Wed Sep 14 19:03:12 2011
@@ -16,10 +16,10 @@
<project name="Pig-internal" default="udf-jar">
<property name="udf.jarfile" value="testudf.jar" />
- <property name="build.dir" value="${basedir}/build" />
+ <property name="udf.build.dir" value="${basedir}/build" />
<!-- <property name="lib.dir" value="${basedir}/lib" />
<property name="pig.jarfile" value="${lib.dir}/pig.jar" /> -->
- <property name="src.dir" value="${basedir}/org/" />
+ <property name="udf.src.dir" value="${basedir}/org/" />
<path id="udf-classpath">
@@ -30,16 +30,17 @@
</path>
<target name="init">
- <mkdir dir="${build.dir}" />
+ <mkdir dir="${udf.build.dir}" />
</target>
<target name="clean">
- <delete dir="${build.dir}" />
+ <delete dir="${udf.build.dir}" />
+ <delete file="${udf.jarfile}" />
</target>
<target name="udf-compile" depends="init, pig.jar.check">
<echo>*** Compiling UDFs ***</echo>
- <javac srcdir="${src.dir}" destdir="${build.dir}" debug="on">
+ <javac srcdir="${udf.src.dir}" destdir="${udf.build.dir}" debug="on">
<classpath refid="udf-classpath" />
</javac>
</target>
Added: pig/branches/branch-0.9/test/e2e/pig/udfs/java/org/apache/pig/test/udf/evalfunc/BadMonitored.java
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.9/test/e2e/pig/udfs/java/org/apache/pig/test/udf/evalfunc/BadMonitored.java?rev=1170769&view=auto
==============================================================================
--- pig/branches/branch-0.9/test/e2e/pig/udfs/java/org/apache/pig/test/udf/evalfunc/BadMonitored.java (added)
+++ pig/branches/branch-0.9/test/e2e/pig/udfs/java/org/apache/pig/test/udf/evalfunc/BadMonitored.java Wed Sep 14 19:03:12 2011
@@ -0,0 +1,39 @@
+/*
+ * 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.pig.test.udf.evalfunc;
+
+import java.io.IOException;
+import org.apache.pig.EvalFunc;
+import org.apache.pig.data.Tuple;
+import org.apache.pig.builtin.MonitoredUDF;
+
+@MonitoredUDF
+public class BadMonitored extends EvalFunc<String>
+{
+ //@Override
+ public String exec(Tuple input) throws IOException
+ {
+ try {
+ Thread.sleep(100000);
+ } catch (InterruptedException ie) {
+ }
+ return "fred";
+ }
+
+}
Added: pig/branches/branch-0.9/test/e2e/pig/udfs/java/org/apache/pig/test/udf/evalfunc/BadMonitoredDefault.java
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.9/test/e2e/pig/udfs/java/org/apache/pig/test/udf/evalfunc/BadMonitoredDefault.java?rev=1170769&view=auto
==============================================================================
--- pig/branches/branch-0.9/test/e2e/pig/udfs/java/org/apache/pig/test/udf/evalfunc/BadMonitoredDefault.java (added)
+++ pig/branches/branch-0.9/test/e2e/pig/udfs/java/org/apache/pig/test/udf/evalfunc/BadMonitoredDefault.java Wed Sep 14 19:03:12 2011
@@ -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.pig.test.udf.evalfunc;
+
+import java.util.concurrent.TimeUnit;
+
+import java.io.IOException;
+import org.apache.pig.EvalFunc;
+import org.apache.pig.data.Tuple;
+import org.apache.pig.builtin.MonitoredUDF;
+
+@MonitoredUDF(timeUnit = TimeUnit.MILLISECONDS, duration=2000,
+ stringDefault = "barney")
+public class BadMonitoredDefault extends EvalFunc<String>
+{
+ //@Override
+ public String exec(Tuple input) throws IOException
+ {
+ try {
+ Thread.sleep(100000);
+ } catch (InterruptedException ie) {
+ }
+ return "fred";
+ }
+
+}
Added: pig/branches/branch-0.9/test/e2e/pig/udfs/java/org/apache/pig/test/udf/evalfunc/GoodMonitored.java
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.9/test/e2e/pig/udfs/java/org/apache/pig/test/udf/evalfunc/GoodMonitored.java?rev=1170769&view=auto
==============================================================================
--- pig/branches/branch-0.9/test/e2e/pig/udfs/java/org/apache/pig/test/udf/evalfunc/GoodMonitored.java (added)
+++ pig/branches/branch-0.9/test/e2e/pig/udfs/java/org/apache/pig/test/udf/evalfunc/GoodMonitored.java Wed Sep 14 19:03:12 2011
@@ -0,0 +1,35 @@
+/*
+ * 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.pig.test.udf.evalfunc;
+
+import java.io.IOException;
+import org.apache.pig.EvalFunc;
+import org.apache.pig.data.Tuple;
+import org.apache.pig.builtin.MonitoredUDF;
+
+@MonitoredUDF
+public class GoodMonitored extends EvalFunc<String>
+{
+ //@Override
+ public String exec(Tuple input) throws IOException
+ {
+ return "fred";
+ }
+
+}
Added: pig/branches/branch-0.9/test/e2e/pig/udfs/java/org/apache/pig/test/udf/evalfunc/Nil.java
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.9/test/e2e/pig/udfs/java/org/apache/pig/test/udf/evalfunc/Nil.java?rev=1170769&view=auto
==============================================================================
--- pig/branches/branch-0.9/test/e2e/pig/udfs/java/org/apache/pig/test/udf/evalfunc/Nil.java (added)
+++ pig/branches/branch-0.9/test/e2e/pig/udfs/java/org/apache/pig/test/udf/evalfunc/Nil.java Wed Sep 14 19:03:12 2011
@@ -0,0 +1,33 @@
+/*
+ * 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.pig.test.udf.evalfunc;
+
+import java.io.IOException;
+import org.apache.pig.EvalFunc;
+import org.apache.pig.data.Tuple;
+
+public class Nil extends EvalFunc<String>
+{
+ //@Override
+ public String exec(Tuple input) throws IOException
+ {
+ return null;
+ }
+
+}
Modified: pig/branches/branch-0.9/test/e2e/pig/udfs/java/org/apache/pig/test/udf/evalfunc/TOBAG.java
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.9/test/e2e/pig/udfs/java/org/apache/pig/test/udf/evalfunc/TOBAG.java?rev=1170769&r1=1170768&r2=1170769&view=diff
==============================================================================
--- pig/branches/branch-0.9/test/e2e/pig/udfs/java/org/apache/pig/test/udf/evalfunc/TOBAG.java (original)
+++ pig/branches/branch-0.9/test/e2e/pig/udfs/java/org/apache/pig/test/udf/evalfunc/TOBAG.java Wed Sep 14 19:03:12 2011
@@ -61,6 +61,9 @@ public class TOBAG extends EvalFunc<Data
} else if ( fieldType.equalsIgnoreCase( "FLOAT" )){
this.fieldType = DataType.FLOAT;
+ } else if ( fieldType.equalsIgnoreCase( "BOOLEAN" )){
+ this.fieldType = DataType.BOOLEAN;
+
} else if ( fieldType.equalsIgnoreCase( "INTEGER" )){
this.fieldType = DataType.INTEGER;
Modified: pig/branches/branch-0.9/test/e2e/pig/udfs/java/org/apache/pig/test/udf/evalfunc/TOMAP.java
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.9/test/e2e/pig/udfs/java/org/apache/pig/test/udf/evalfunc/TOMAP.java?rev=1170769&r1=1170768&r2=1170769&view=diff
==============================================================================
--- pig/branches/branch-0.9/test/e2e/pig/udfs/java/org/apache/pig/test/udf/evalfunc/TOMAP.java (original)
+++ pig/branches/branch-0.9/test/e2e/pig/udfs/java/org/apache/pig/test/udf/evalfunc/TOMAP.java Wed Sep 14 19:03:12 2011
@@ -15,6 +15,8 @@
* limitations under the License.
*/
+package org.apache.pig.test.udf.evalfunc;
+
import java.io.IOException;
import org.apache.pig.EvalFunc;
@@ -29,7 +31,6 @@ import java.util.HashMap;
import org.apache.pig.PigException;
import org.apache.pig.backend.executionengine.ExecException;
-
public class TOMAP extends EvalFunc<HashMap<String,Object>> {
@Override
Modified: pig/branches/branch-0.9/test/e2e/pig/udfs/java/org/apache/pig/test/udf/evalfunc/VARBAG.java
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.9/test/e2e/pig/udfs/java/org/apache/pig/test/udf/evalfunc/VARBAG.java?rev=1170769&r1=1170768&r2=1170769&view=diff
==============================================================================
--- pig/branches/branch-0.9/test/e2e/pig/udfs/java/org/apache/pig/test/udf/evalfunc/VARBAG.java (original)
+++ pig/branches/branch-0.9/test/e2e/pig/udfs/java/org/apache/pig/test/udf/evalfunc/VARBAG.java Wed Sep 14 19:03:12 2011
@@ -60,6 +60,9 @@ public class VARBAG extends EvalFunc<Dat
} else if ( fieldType.equalsIgnoreCase( "FLOAT" )){
this.fieldType = DataType.FLOAT;
+ } else if ( fieldType.equalsIgnoreCase( "BOOLEAN" )) {
+ this.fieldType = DataType.BOOLEAN;
+
} else if ( fieldType.equalsIgnoreCase( "INTEGER" )){
this.fieldType = DataType.INTEGER;
Modified: pig/branches/branch-0.9/test/e2e/pig/udfs/java/org/apache/pig/test/udf/storefunc/PigPerformanceLoader.java
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.9/test/e2e/pig/udfs/java/org/apache/pig/test/udf/storefunc/PigPerformanceLoader.java?rev=1170769&r1=1170768&r2=1170769&view=diff
==============================================================================
--- pig/branches/branch-0.9/test/e2e/pig/udfs/java/org/apache/pig/test/udf/storefunc/PigPerformanceLoader.java (original)
+++ pig/branches/branch-0.9/test/e2e/pig/udfs/java/org/apache/pig/test/udf/storefunc/PigPerformanceLoader.java Wed Sep 14 19:03:12 2011
@@ -154,6 +154,10 @@ public class PigPerformanceLoader extend
public Long bytesToLong(byte[] arg0) throws IOException {
return helper.bytesToLong(arg0);
}
+
+ public Boolean bytesToBoolean(byte[] arg0) throws IOException {
+ return helper.bytesToBoolean(arg0);
+ }
@Override
public Tuple bytesToTuple(byte[] arg0, ResourceFieldSchema fs) throws IOException {