You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hdt.apache.org by ad...@apache.org on 2013/01/08 23:26:26 UTC
[6/11] Import of source from Apache Hadoop MapReduce contrib,
this is the plugin as it existed in the Hadoop 0.23.4 release.
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/8f/8f986e5d2f11ddfe3475de19f1da54971a2686cf.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/8f/8f986e5d2f11ddfe3475de19f1da54971a2686cf.svn-base b/eclipse-plugin/.svn/pristine/8f/8f986e5d2f11ddfe3475de19f1da54971a2686cf.svn-base
new file mode 100644
index 0000000..444050a
--- /dev/null
+++ b/eclipse-plugin/.svn/pristine/8f/8f986e5d2f11ddfe3475de19f1da54971a2686cf.svn-base
@@ -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.hadoop.eclipse.preferences;
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+
+/**
+ * Class used to initialize default preference values.
+ */
+public class PreferenceInitializer extends AbstractPreferenceInitializer {
+
+ /* @inheritDoc */
+ @Override
+ public void initializeDefaultPreferences() {
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/91/91c0af50263de89e6a5ca7fee02dad8cfc4b79db.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/91/91c0af50263de89e6a5ca7fee02dad8cfc4b79db.svn-base b/eclipse-plugin/.svn/pristine/91/91c0af50263de89e6a5ca7fee02dad8cfc4b79db.svn-base
new file mode 100644
index 0000000..5721a7a
Binary files /dev/null and b/eclipse-plugin/.svn/pristine/91/91c0af50263de89e6a5ca7fee02dad8cfc4b79db.svn-base differ
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/9a/9a83a72969c681cfbc2839502b182f93dc238101.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/9a/9a83a72969c681cfbc2839502b182f93dc238101.svn-base b/eclipse-plugin/.svn/pristine/9a/9a83a72969c681cfbc2839502b182f93dc238101.svn-base
new file mode 100644
index 0000000..530baf9
Binary files /dev/null and b/eclipse-plugin/.svn/pristine/9a/9a83a72969c681cfbc2839502b182f93dc238101.svn-base differ
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/9c/9cc7211b9d72ac557689d5a657a0064c753dc48f.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/9c/9cc7211b9d72ac557689d5a657a0064c753dc48f.svn-base b/eclipse-plugin/.svn/pristine/9c/9cc7211b9d72ac557689d5a657a0064c753dc48f.svn-base
new file mode 100644
index 0000000..6f6058c
--- /dev/null
+++ b/eclipse-plugin/.svn/pristine/9c/9cc7211b9d72ac557689d5a657a0064c753dc48f.svn-base
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+
+<projectDescription>
+ <name>MapReduceTools</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/9f/9f31b14a065cc86cb7c91cb73bd90c695f2b5b77.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/9f/9f31b14a065cc86cb7c91cb73bd90c695f2b5b77.svn-base b/eclipse-plugin/.svn/pristine/9f/9f31b14a065cc86cb7c91cb73bd90c695f2b5b77.svn-base
new file mode 100644
index 0000000..3aa55dd
--- /dev/null
+++ b/eclipse-plugin/.svn/pristine/9f/9f31b14a065cc86cb7c91cb73bd90c695f2b5b77.svn-base
@@ -0,0 +1,19 @@
+# Licensed 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.
+
+output.. = bin/
+bin.includes = META-INF/,\
+ plugin.xml,\
+ resources/,\
+ classes/,\
+ classes/,\
+ lib/
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/9f/9f3eab744ca42e650c9ff36e7f7a2b7e69596ed8.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/9f/9f3eab744ca42e650c9ff36e7f7a2b7e69596ed8.svn-base b/eclipse-plugin/.svn/pristine/9f/9f3eab744ca42e650c9ff36e7f7a2b7e69596ed8.svn-base
new file mode 100644
index 0000000..1f36b54
Binary files /dev/null and b/eclipse-plugin/.svn/pristine/9f/9f3eab744ca42e650c9ff36e7f7a2b7e69596ed8.svn-base differ
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/a0/a09903ee6f8e9c8bd974a3707b735ccfe0b4349a.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/a0/a09903ee6f8e9c8bd974a3707b735ccfe0b4349a.svn-base b/eclipse-plugin/.svn/pristine/a0/a09903ee6f8e9c8bd974a3707b735ccfe0b4349a.svn-base
new file mode 100644
index 0000000..fdf8a41
Binary files /dev/null and b/eclipse-plugin/.svn/pristine/a0/a09903ee6f8e9c8bd974a3707b735ccfe0b4349a.svn-base differ
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/a2/a2d23a5c98652cbdc9b319907981c89e2917ea3a.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/a2/a2d23a5c98652cbdc9b319907981c89e2917ea3a.svn-base b/eclipse-plugin/.svn/pristine/a2/a2d23a5c98652cbdc9b319907981c89e2917ea3a.svn-base
new file mode 100644
index 0000000..b30af6b
Binary files /dev/null and b/eclipse-plugin/.svn/pristine/a2/a2d23a5c98652cbdc9b319907981c89e2917ea3a.svn-base differ
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/a6/a6050a20fd8ca1d0834fbd6f8367eb1ef2f94225.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/a6/a6050a20fd8ca1d0834fbd6f8367eb1ef2f94225.svn-base b/eclipse-plugin/.svn/pristine/a6/a6050a20fd8ca1d0834fbd6f8367eb1ef2f94225.svn-base
new file mode 100644
index 0000000..8a80dd8
--- /dev/null
+++ b/eclipse-plugin/.svn/pristine/a6/a6050a20fd8ca1d0834fbd6f8367eb1ef2f94225.svn-base
@@ -0,0 +1,17 @@
+# Licensed 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.
+
+#This properties file lists the versions of the various artifacts used by streaming.
+#It drives ivy and the generation of a maven POM
+
+#Please list the dependencies name with version if they are different from the ones
+#listed in the global libraries.properties file (in alphabetical order)
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/a9/a924db5e40e5b76fa9fd25ce0a90890a79d87f94.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/a9/a924db5e40e5b76fa9fd25ce0a90890a79d87f94.svn-base b/eclipse-plugin/.svn/pristine/a9/a924db5e40e5b76fa9fd25ce0a90890a79d87f94.svn-base
new file mode 100644
index 0000000..a70b1e4
Binary files /dev/null and b/eclipse-plugin/.svn/pristine/a9/a924db5e40e5b76fa9fd25ce0a90890a79d87f94.svn-base differ
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/a9/a99279046fde7107cba9320f621d16b0ded42d94.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/a9/a99279046fde7107cba9320f621d16b0ded42d94.svn-base b/eclipse-plugin/.svn/pristine/a9/a99279046fde7107cba9320f621d16b0ded42d94.svn-base
new file mode 100644
index 0000000..288a5d4
Binary files /dev/null and b/eclipse-plugin/.svn/pristine/a9/a99279046fde7107cba9320f621d16b0ded42d94.svn-base differ
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/ab/ab6d568040fb1f71ed3186bb7dcfcfa7cfc5879c.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/ab/ab6d568040fb1f71ed3186bb7dcfcfa7cfc5879c.svn-base b/eclipse-plugin/.svn/pristine/ab/ab6d568040fb1f71ed3186bb7dcfcfa7cfc5879c.svn-base
new file mode 100644
index 0000000..4a71dcb
--- /dev/null
+++ b/eclipse-plugin/.svn/pristine/ab/ab6d568040fb1f71ed3186bb7dcfcfa7cfc5879c.svn-base
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+
+<cheatsheet title="MapReduce project creation tutorial">
+ <intro>
+ <description>
+ This tutorial guides you through the creation of a simple
+ MapReduce project with three MapReduce classes: a Mapper, a
+ Reducer, and a Driver.
+ </description>
+ </intro>
+ <item title="Open the MapReduce Perspective">
+ <action pluginId="org.eclipse.ui.cheatsheets"
+ class="org.eclipse.ui.internal.cheatsheets.actions.OpenPerspective"
+ param1="org.apache.hadoop.eclipse.Perspective" />
+ <description>
+ Select <b>Window->Open Perspective->MapReduce</b> in the menubar at
+ the top of the workbench. This step changes the perspective
+ to set up the Eclipse workbench for MapReduce development.
+ </description>
+ </item>
+ <item title="Create a MapReduce project" skip="true">
+ <action pluginId="com.ibm.hipods.mapreduce"
+ class="org.apache.hadoop.eclipse.actions.OpenNewMRProjectAction" />
+ <description>
+ The first thing you will need is a MapReduce Project. If you
+ already have a MapReduce project in your workspace that you
+ would like to use, you may skip this step by clicking the
+ "Click to Skip" button. If not, select <b>File->New->Project</b>
+ and choose MapReduce Project in the list. Complete the
+ subsequent pages as required.
+ </description>
+ </item>
+ <item title="Create a MapReduce package" skip="true">
+ <action pluginId="org.eclipse.jdt.ui"
+ class="org.eclipse.jdt.ui.actions.OpenNewPackageWizardAction" />
+ <description>
+ You should now have a MapReduce project in your workspace.
+ The next thing to do is creating a package. Use the Eclipse
+ tools by selecting <b>File -> New ->Package</b> action. Specify the
+ source folder (the project containing the package). Then,
+ give the package a name, such as "mapreduce.test", and click
+ the "Finish" button. If you already have a project with a
+ package you might as well skip this step.
+ </description>
+ </item>
+ <item title="Create the MapReduce application classes" skip="true">
+ <description>
+ Now you should be set up for creating your MapReduce
+ application. The MapReduce application consists of three
+ classes: a Mapper class, a Reducer class and a Driver class.
+ In this step you will create the three classes. Use the
+ class wizard by selecting <b>File -> New -> Class</b>.
+ Repeat this for every class.
+ </description>
+ <repeated-subitem values="Mapper,Reducer,Driver">
+ <subitem label="Create the class ${this}.">
+ <action pluginId="com.ibm.hipods.mapreduce"
+ class="org.apache.hadoop.eclipse.actions.OpenNewMRClassWizardAction"
+ param1="${this}" />
+ </subitem>
+ </repeated-subitem>
+ </item>
+</cheatsheet>
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/ac/ac5e3da20f25f4993aa9f9cbce98e96c57388ee5.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/ac/ac5e3da20f25f4993aa9f9cbce98e96c57388ee5.svn-base b/eclipse-plugin/.svn/pristine/ac/ac5e3da20f25f4993aa9f9cbce98e96c57388ee5.svn-base
new file mode 100644
index 0000000..df609f3
Binary files /dev/null and b/eclipse-plugin/.svn/pristine/ac/ac5e3da20f25f4993aa9f9cbce98e96c57388ee5.svn-base differ
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/ae/ae708e2673560cf1cdbbd11958aba6e783d8586b.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/ae/ae708e2673560cf1cdbbd11958aba6e783d8586b.svn-base b/eclipse-plugin/.svn/pristine/ae/ae708e2673560cf1cdbbd11958aba6e783d8586b.svn-base
new file mode 100644
index 0000000..80f650e
Binary files /dev/null and b/eclipse-plugin/.svn/pristine/ae/ae708e2673560cf1cdbbd11958aba6e783d8586b.svn-base differ
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/ae/aec66d8edfbc088e41ce0fe44a3c5a8f42e39db7.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/ae/aec66d8edfbc088e41ce0fe44a3c5a8f42e39db7.svn-base b/eclipse-plugin/.svn/pristine/ae/aec66d8edfbc088e41ce0fe44a3c5a8f42e39db7.svn-base
new file mode 100644
index 0000000..047ba17
--- /dev/null
+++ b/eclipse-plugin/.svn/pristine/ae/aec66d8edfbc088e41ce0fe44a3c5a8f42e39db7.svn-base
@@ -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.hadoop.eclipse.launch;
+
+import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
+import org.eclipse.debug.ui.CommonTab;
+import org.eclipse.debug.ui.ILaunchConfigurationDialog;
+import org.eclipse.debug.ui.ILaunchConfigurationTab;
+import org.eclipse.jdt.debug.ui.launchConfigurations.JavaArgumentsTab;
+import org.eclipse.jdt.debug.ui.launchConfigurations.JavaClasspathTab;
+import org.eclipse.jdt.debug.ui.launchConfigurations.JavaJRETab;
+
+/**
+ * Create the tab group for the dialog window for starting a Hadoop job.
+ */
+
+public class StartHadoopLaunchTabGroup extends
+ AbstractLaunchConfigurationTabGroup {
+
+ public StartHadoopLaunchTabGroup() {
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * TODO(jz) consider the appropriate tabs for this case
+ */
+ public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
+ setTabs(new ILaunchConfigurationTab[] { new JavaArgumentsTab(),
+ new JavaJRETab(), new JavaClasspathTab(), new CommonTab() });
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/b5/b54a3edf47432ce011df6c94cd319b73dc024f84.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/b5/b54a3edf47432ce011df6c94cd319b73dc024f84.svn-base b/eclipse-plugin/.svn/pristine/b5/b54a3edf47432ce011df6c94cd319b73dc024f84.svn-base
new file mode 100644
index 0000000..01c2b57
Binary files /dev/null and b/eclipse-plugin/.svn/pristine/b5/b54a3edf47432ce011df6c94cd319b73dc024f84.svn-base differ
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/b6/b64bc110f9146bc32d0bbd907ae587dea9ce9e77.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/b6/b64bc110f9146bc32d0bbd907ae587dea9ce9e77.svn-base b/eclipse-plugin/.svn/pristine/b6/b64bc110f9146bc32d0bbd907ae587dea9ce9e77.svn-base
new file mode 100644
index 0000000..24fec89
Binary files /dev/null and b/eclipse-plugin/.svn/pristine/b6/b64bc110f9146bc32d0bbd907ae587dea9ce9e77.svn-base differ
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/b7/b71bea0253f3ecd4fbe183dfa5bcabe5c950b741.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/b7/b71bea0253f3ecd4fbe183dfa5bcabe5c950b741.svn-base b/eclipse-plugin/.svn/pristine/b7/b71bea0253f3ecd4fbe183dfa5bcabe5c950b741.svn-base
new file mode 100644
index 0000000..036469a
Binary files /dev/null and b/eclipse-plugin/.svn/pristine/b7/b71bea0253f3ecd4fbe183dfa5bcabe5c950b741.svn-base differ
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/b8/b834a2f72808f6aed8a8be62458cbb5537ea64d9.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/b8/b834a2f72808f6aed8a8be62458cbb5537ea64d9.svn-base b/eclipse-plugin/.svn/pristine/b8/b834a2f72808f6aed8a8be62458cbb5537ea64d9.svn-base
new file mode 100644
index 0000000..0d65327
Binary files /dev/null and b/eclipse-plugin/.svn/pristine/b8/b834a2f72808f6aed8a8be62458cbb5537ea64d9.svn-base differ
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/c4/c4d949ae608675100f2619f6bf816d090fc7f7bd.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/c4/c4d949ae608675100f2619f6bf816d090fc7f7bd.svn-base b/eclipse-plugin/.svn/pristine/c4/c4d949ae608675100f2619f6bf816d090fc7f7bd.svn-base
new file mode 100644
index 0000000..af4f048
--- /dev/null
+++ b/eclipse-plugin/.svn/pristine/c4/c4d949ae608675100f2619f6bf816d090fc7f7bd.svn-base
@@ -0,0 +1,28 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: MapReduce Tools for Eclipse
+Bundle-SymbolicName: org.apache.hadoop.eclipse;singleton:=true
+Bundle-Version: 0.18
+Bundle-Activator: org.apache.hadoop.eclipse.Activator
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.jdt.launching,
+ org.eclipse.debug.core,
+ org.eclipse.jdt,
+ org.eclipse.jdt.core,
+ org.eclipse.core.resources,
+ org.eclipse.ui.ide,
+ org.eclipse.jdt.ui,
+ org.eclipse.debug.ui,
+ org.eclipse.jdt.debug.ui,
+ org.eclipse.core.expressions,
+ org.eclipse.ui.cheatsheets,
+ org.eclipse.ui.console,
+ org.eclipse.ui.navigator,
+ org.eclipse.core.filesystem,
+ org.apache.commons.logging
+Eclipse-LazyStart: true
+Bundle-ClassPath: classes/,
+ lib/hadoop-core.jar
+Bundle-Vendor: Apache Hadoop
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/c5/c51f63ec276dc4fd7497dd9a875bf2248b8d09ec.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/c5/c51f63ec276dc4fd7497dd9a875bf2248b8d09ec.svn-base b/eclipse-plugin/.svn/pristine/c5/c51f63ec276dc4fd7497dd9a875bf2248b8d09ec.svn-base
new file mode 100644
index 0000000..cc1f9ec
--- /dev/null
+++ b/eclipse-plugin/.svn/pristine/c5/c51f63ec276dc4fd7497dd9a875bf2248b8d09ec.svn-base
@@ -0,0 +1,76 @@
+/**
+ * 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.hadoop.eclipse.actions;
+
+import java.util.logging.Logger;
+
+import org.apache.hadoop.eclipse.NewDriverWizard;
+import org.apache.hadoop.eclipse.NewMapperWizard;
+import org.apache.hadoop.eclipse.NewReducerWizard;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.cheatsheets.ICheatSheetAction;
+import org.eclipse.ui.cheatsheets.ICheatSheetManager;
+
+
+/**
+ * Action to open a new MapReduce Class.
+ */
+
+public class OpenNewMRClassWizardAction extends Action implements
+ ICheatSheetAction {
+
+ static Logger log = Logger.getLogger(OpenNewMRClassWizardAction.class
+ .getName());
+
+ public void run(String[] params, ICheatSheetManager manager) {
+
+ if ((params != null) && (params.length > 0)) {
+ IWorkbench workbench = PlatformUI.getWorkbench();
+ INewWizard wizard = getWizard(params[0]);
+ wizard.init(workbench, new StructuredSelection());
+ WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getShell(), wizard);
+ dialog.create();
+ dialog.open();
+
+ // did the wizard succeed ?
+ notifyResult(dialog.getReturnCode() == Window.OK);
+ }
+ }
+
+ private INewWizard getWizard(String typeName) {
+ if (typeName.equals("Mapper")) {
+ return new NewMapperWizard();
+ } else if (typeName.equals("Reducer")) {
+ return new NewReducerWizard();
+ } else if (typeName.equals("Driver")) {
+ return new NewDriverWizard();
+ } else {
+ log.severe("Invalid Wizard requested");
+ return null;
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/c7/c7749a41d816b798dae563ae10d0c073ed6768ef.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/c7/c7749a41d816b798dae563ae10d0c073ed6768ef.svn-base b/eclipse-plugin/.svn/pristine/c7/c7749a41d816b798dae563ae10d0c073ed6768ef.svn-base
new file mode 100644
index 0000000..0927b13
Binary files /dev/null and b/eclipse-plugin/.svn/pristine/c7/c7749a41d816b798dae563ae10d0c073ed6768ef.svn-base differ
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/c7/c77c926f20e3848a96df67c8349993ffc12b42af.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/c7/c77c926f20e3848a96df67c8349993ffc12b42af.svn-base b/eclipse-plugin/.svn/pristine/c7/c77c926f20e3848a96df67c8349993ffc12b42af.svn-base
new file mode 100644
index 0000000..80040d4
--- /dev/null
+++ b/eclipse-plugin/.svn/pristine/c7/c77c926f20e3848a96df67c8349993ffc12b42af.svn-base
@@ -0,0 +1,17 @@
+#Tue Aug 14 19:41:15 PDT 2007
+## Licensed 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.
+DELEGATES_PREFERENCE=delegateValidatorListorg.eclipse.wst.xsd.core.internal.validation.eclipse.XSDDelegatingValidator\=org.eclipse.wst.xsd.core.internal.validation.eclipse.Validator;org.eclipse.wst.wsdl.validation.internal.eclipse.WSDLDelegatingValidator\=org.eclipse.wst.wsdl.validation.internal.eclipse.Validator;
+USER_BUILD_PREFERENCE=enabledBuildValidatorListorg.eclipse.wst.xsd.core.internal.validation.eclipse.XSDDelegatingValidator;org.eclipse.jst.jsp.core.internal.validation.JSPContentValidator;org.eclipse.wst.html.internal.validation.HTMLValidator;org.eclipse.wst.xml.core.internal.validation.eclipse.Validator;org.eclipse.jst.jsf.validation.internal.appconfig.AppConfigValidator;org.eclipse.jst.jsp.core.internal.validation.JSPBatchValidator;org.eclipse.wst.dtd.core.internal.validation.eclipse.Validator;org.eclipse.wst.wsi.ui.internal.WSIMessageValidator;org.eclipse.wst.wsdl.validation.internal.eclipse.WSDLDelegatingValidator;org.eclipse.jst.jsf.validation.internal.JSPSemanticsValidator;
+USER_MANUAL_PREFERENCE=enabledManualValidatorListorg.eclipse.wst.xsd.core.internal.validation.eclipse.XSDDelegatingValidator;org.eclipse.jst.jsp.core.internal.validation.JSPContentValidator;org.eclipse.wst.html.internal.validation.HTMLValidator;org.eclipse.wst.xml.core.internal.validation.eclipse.Validator;org.eclipse.jst.jsf.validation.internal.appconfig.AppConfigValidator;org.eclipse.jst.jsp.core.internal.validation.JSPBatchValidator;org.eclipse.wst.dtd.core.internal.validation.eclipse.Validator;org.eclipse.wst.wsi.ui.internal.WSIMessageValidator;org.eclipse.wst.wsdl.validation.internal.eclipse.WSDLDelegatingValidator;org.eclipse.jst.jsf.validation.internal.JSPSemanticsValidator;
+USER_PREFERENCE=overrideGlobalPreferencesfalse
+eclipse.preferences.version=1
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/c9/c9628aa048eda3458d1a862df0b47e1e2858c428.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/c9/c9628aa048eda3458d1a862df0b47e1e2858c428.svn-base b/eclipse-plugin/.svn/pristine/c9/c9628aa048eda3458d1a862df0b47e1e2858c428.svn-base
new file mode 100644
index 0000000..d9f1de8
Binary files /dev/null and b/eclipse-plugin/.svn/pristine/c9/c9628aa048eda3458d1a862df0b47e1e2858c428.svn-base differ
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/c9/c988c932f3579af9b22470847d1cb91241f26cb3.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/c9/c988c932f3579af9b22470847d1cb91241f26cb3.svn-base b/eclipse-plugin/.svn/pristine/c9/c988c932f3579af9b22470847d1cb91241f26cb3.svn-base
new file mode 100644
index 0000000..3c65173
--- /dev/null
+++ b/eclipse-plugin/.svn/pristine/c9/c988c932f3579af9b22470847d1cb91241f26cb3.svn-base
@@ -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.hadoop.eclipse.servers;
+
+import org.apache.hadoop.eclipse.server.HadoopServer;
+
+/**
+ * Interface for monitoring server changes
+ */
+public interface IHadoopServerListener {
+ void serverChanged(HadoopServer location, int type);
+}
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/cf/cf8ca7e2d66419728293ddb93899c5242944edf6.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/cf/cf8ca7e2d66419728293ddb93899c5242944edf6.svn-base b/eclipse-plugin/.svn/pristine/cf/cf8ca7e2d66419728293ddb93899c5242944edf6.svn-base
new file mode 100644
index 0000000..318a570
Binary files /dev/null and b/eclipse-plugin/.svn/pristine/cf/cf8ca7e2d66419728293ddb93899c5242944edf6.svn-base differ
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/d5/d5a7dfde655f8f0712cb894b5a0db8fa6e994cb0.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/d5/d5a7dfde655f8f0712cb894b5a0db8fa6e994cb0.svn-base b/eclipse-plugin/.svn/pristine/d5/d5a7dfde655f8f0712cb894b5a0db8fa6e994cb0.svn-base
new file mode 100644
index 0000000..4993aab
Binary files /dev/null and b/eclipse-plugin/.svn/pristine/d5/d5a7dfde655f8f0712cb894b5a0db8fa6e994cb0.svn-base differ
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/d7/d749850125433806434b24be33f64288e51a8566.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/d7/d749850125433806434b24be33f64288e51a8566.svn-base b/eclipse-plugin/.svn/pristine/d7/d749850125433806434b24be33f64288e51a8566.svn-base
new file mode 100644
index 0000000..f7252d5
--- /dev/null
+++ b/eclipse-plugin/.svn/pristine/d7/d749850125433806434b24be33f64288e51a8566.svn-base
@@ -0,0 +1,517 @@
+/**
+ * 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.hadoop.eclipse.server;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.logging.Logger;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.eclipse.Activator;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.io.IOUtils;
+import org.apache.hadoop.mapred.JobClient;
+import org.apache.hadoop.mapred.JobConf;
+import org.apache.hadoop.mapred.JobID;
+import org.apache.hadoop.mapred.JobStatus;
+import org.apache.hadoop.mapred.RunningJob;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.swt.widgets.Display;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Text;
+import org.xml.sax.SAXException;
+
+/**
+ * Representation of a Hadoop location, meaning of the master node (NameNode,
+ * JobTracker).
+ *
+ * <p>
+ * This class does not create any SSH connection anymore. Tunneling must be
+ * setup outside of Eclipse for now (using Putty or <tt>ssh -D<port>
+ * <host></tt>)
+ *
+ * <p>
+ * <em> TODO </em>
+ * <li> Disable the updater if a location becomes unreachable or fails for
+ * tool long
+ * <li> Stop the updater on location's disposal/removal
+ */
+
+public class HadoopServer {
+
+ /**
+ * Frequency of location status observations expressed as the delay in ms
+ * between each observation
+ *
+ * TODO Add a preference parameter for this
+ */
+ protected static final long STATUS_OBSERVATION_DELAY = 1500;
+
+ /**
+ *
+ */
+ public class LocationStatusUpdater extends Job {
+
+ JobClient client = null;
+
+ /**
+ * Setup the updater
+ */
+ public LocationStatusUpdater() {
+ super("Map/Reduce location status updater");
+ this.setSystem(true);
+ }
+
+ /* @inheritDoc */
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ if (client == null) {
+ try {
+ client = HadoopServer.this.getJobClient();
+
+ } catch (IOException ioe) {
+ client = null;
+ return new Status(Status.ERROR, Activator.PLUGIN_ID, 0,
+ "Cannot connect to the Map/Reduce location: "
+ + HadoopServer.this.getLocationName(),
+ ioe);
+ }
+ }
+
+ try {
+ // Set of all known existing Job IDs we want fresh info of
+ Set<JobID> missingJobIds =
+ new HashSet<JobID>(runningJobs.keySet());
+
+ JobStatus[] jstatus = client.jobsToComplete();
+ for (JobStatus status : jstatus) {
+
+ JobID jobId = status.getJobID();
+ missingJobIds.remove(jobId);
+
+ HadoopJob hJob;
+ synchronized (HadoopServer.this.runningJobs) {
+ hJob = runningJobs.get(jobId);
+ if (hJob == null) {
+ // Unknown job, create an entry
+ RunningJob running = client.getJob(jobId);
+ hJob =
+ new HadoopJob(HadoopServer.this, jobId, running, status);
+ newJob(hJob);
+ }
+ }
+
+ // Update HadoopJob with fresh infos
+ updateJob(hJob, status);
+ }
+
+ // Ask explicitly for fresh info for these Job IDs
+ for (JobID jobId : missingJobIds) {
+ HadoopJob hJob = runningJobs.get(jobId);
+ if (!hJob.isCompleted())
+ updateJob(hJob, null);
+ }
+
+ } catch (IOException ioe) {
+ client = null;
+ return new Status(Status.ERROR, Activator.PLUGIN_ID, 0,
+ "Cannot retrieve running Jobs on location: "
+ + HadoopServer.this.getLocationName(), ioe);
+ }
+
+ // Schedule the next observation
+ schedule(STATUS_OBSERVATION_DELAY);
+
+ return Status.OK_STATUS;
+ }
+
+ /**
+ * Stores and make the new job available
+ *
+ * @param data
+ */
+ private void newJob(final HadoopJob data) {
+ runningJobs.put(data.getJobID(), data);
+
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ fireJobAdded(data);
+ }
+ });
+ }
+
+ /**
+ * Updates the status of a job
+ *
+ * @param job the job to update
+ */
+ private void updateJob(final HadoopJob job, JobStatus status) {
+ job.update(status);
+
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ fireJobChanged(job);
+ }
+ });
+ }
+
+ }
+
+ static Logger log = Logger.getLogger(HadoopServer.class.getName());
+
+ /**
+ * Hadoop configuration of the location. Also contains specific parameters
+ * for the plug-in. These parameters are prefix with eclipse.plug-in.*
+ */
+ private Configuration conf;
+
+ /**
+ * Jobs listeners
+ */
+ private Set<IJobListener> jobListeners = new HashSet<IJobListener>();
+
+ /**
+ * Jobs running on this location. The keys of this map are the Job IDs.
+ */
+ private transient Map<JobID, HadoopJob> runningJobs =
+ Collections.synchronizedMap(new TreeMap<JobID, HadoopJob>());
+
+ /**
+ * Status updater for this location
+ */
+ private LocationStatusUpdater statusUpdater;
+
+ // state and status - transient
+ private transient String state = "";
+
+ /**
+ * Creates a new default Hadoop location
+ */
+ public HadoopServer() {
+ this.conf = new Configuration();
+ this.addPluginConfigDefaultProperties();
+ }
+
+ /**
+ * Creates a location from a file
+ *
+ * @throws IOException
+ * @throws SAXException
+ * @throws ParserConfigurationException
+ */
+ public HadoopServer(File file) throws ParserConfigurationException,
+ SAXException, IOException {
+
+ this.conf = new Configuration();
+ this.addPluginConfigDefaultProperties();
+ this.loadFromXML(file);
+ }
+
+ /**
+ * Create a new Hadoop location by copying an already existing one.
+ *
+ * @param source the location to copy
+ */
+ public HadoopServer(HadoopServer existing) {
+ this();
+ this.load(existing);
+ }
+
+ public void addJobListener(IJobListener l) {
+ jobListeners.add(l);
+ }
+
+ public void dispose() {
+ // TODO close DFS connections?
+ }
+
+ /**
+ * List all elements that should be present in the Server window (all
+ * servers and all jobs running on each servers)
+ *
+ * @return collection of jobs for this location
+ */
+ public Collection<HadoopJob> getJobs() {
+ startStatusUpdater();
+ return this.runningJobs.values();
+ }
+
+ /**
+ * Remove the given job from the currently running jobs map
+ *
+ * @param job the job to remove
+ */
+ public void purgeJob(final HadoopJob job) {
+ runningJobs.remove(job.getJobID());
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ fireJobRemoved(job);
+ }
+ });
+ }
+
+ /**
+ * Returns the {@link Configuration} defining this location.
+ *
+ * @return the location configuration
+ */
+ public Configuration getConfiguration() {
+ return this.conf;
+ }
+
+ /**
+ * Gets a Hadoop configuration property value
+ *
+ * @param prop the configuration property
+ * @return the property value
+ */
+ public String getConfProp(ConfProp prop) {
+ return prop.get(conf);
+ }
+
+ /**
+ * Gets a Hadoop configuration property value
+ *
+ * @param propName the property name
+ * @return the property value
+ */
+ public String getConfProp(String propName) {
+ return this.conf.get(propName);
+ }
+
+ public String getLocationName() {
+ return ConfProp.PI_LOCATION_NAME.get(conf);
+ }
+
+ /**
+ * Returns the master host name of the Hadoop location (the Job tracker)
+ *
+ * @return the host name of the Job tracker
+ */
+ public String getMasterHostName() {
+ return getConfProp(ConfProp.PI_JOB_TRACKER_HOST);
+ }
+
+ public String getState() {
+ return state;
+ }
+
+ /**
+ * Overwrite this location with the given existing location
+ *
+ * @param existing the existing location
+ */
+ public void load(HadoopServer existing) {
+ this.conf = new Configuration(existing.conf);
+ }
+
+ /**
+ * Overwrite this location with settings available in the given XML file.
+ * The existing configuration is preserved if the XML file is invalid.
+ *
+ * @param file the file path of the XML file
+ * @return validity of the XML file
+ * @throws ParserConfigurationException
+ * @throws IOException
+ * @throws SAXException
+ */
+ public boolean loadFromXML(File file) throws ParserConfigurationException,
+ SAXException, IOException {
+
+ Configuration newConf = new Configuration(this.conf);
+
+ DocumentBuilder builder =
+ DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ Document document = builder.parse(file);
+
+ Element root = document.getDocumentElement();
+ if (!"configuration".equals(root.getTagName()))
+ return false;
+ NodeList props = root.getChildNodes();
+ for (int i = 0; i < props.getLength(); i++) {
+ Node propNode = props.item(i);
+ if (!(propNode instanceof Element))
+ continue;
+ Element prop = (Element) propNode;
+ if (!"property".equals(prop.getTagName()))
+ return false;
+ NodeList fields = prop.getChildNodes();
+ String attr = null;
+ String value = null;
+ for (int j = 0; j < fields.getLength(); j++) {
+ Node fieldNode = fields.item(j);
+ if (!(fieldNode instanceof Element))
+ continue;
+ Element field = (Element) fieldNode;
+ if ("name".equals(field.getTagName()))
+ attr = ((Text) field.getFirstChild()).getData();
+ if ("value".equals(field.getTagName()) && field.hasChildNodes())
+ value = ((Text) field.getFirstChild()).getData();
+ }
+ if (attr != null && value != null)
+ newConf.set(attr, value);
+ }
+
+ this.conf = newConf;
+ return true;
+ }
+
+ /**
+ * Sets a Hadoop configuration property value
+ *
+ * @param prop the property
+ * @param propvalue the property value
+ */
+ public void setConfProp(ConfProp prop, String propValue) {
+ prop.set(conf, propValue);
+ }
+
+ /**
+ * Sets a Hadoop configuration property value
+ *
+ * @param propName the property name
+ * @param propValue the property value
+ */
+ public void setConfProp(String propName, String propValue) {
+ this.conf.set(propName, propValue);
+ }
+
+ public void setLocationName(String newName) {
+ ConfProp.PI_LOCATION_NAME.set(conf, newName);
+ }
+
+ /**
+ * Write this location settings to the given output stream
+ *
+ * @param out the output stream
+ * @throws IOException
+ */
+ public void storeSettingsToFile(File file) throws IOException {
+ FileOutputStream fos = new FileOutputStream(file);
+ try {
+ this.conf.writeXml(fos);
+ fos.close();
+ fos = null;
+ } finally {
+ IOUtils.closeStream(fos);
+ }
+
+ }
+
+ /* @inheritDoc */
+ @Override
+ public String toString() {
+ return this.getLocationName();
+ }
+
+ /**
+ * Fill the configuration with valid default values
+ */
+ private void addPluginConfigDefaultProperties() {
+ for (ConfProp prop : ConfProp.values()) {
+ if (conf.get(prop.name) == null)
+ conf.set(prop.name, prop.defVal);
+ }
+ }
+
+ /**
+ * Starts the location status updater
+ */
+ private synchronized void startStatusUpdater() {
+ if (statusUpdater == null) {
+ statusUpdater = new LocationStatusUpdater();
+ statusUpdater.schedule();
+ }
+ }
+
+ /*
+ * Rewrite of the connecting and tunneling to the Hadoop location
+ */
+
+ /**
+ * Provides access to the default file system of this location.
+ *
+ * @return a {@link FileSystem}
+ */
+ public FileSystem getDFS() throws IOException {
+ return FileSystem.get(this.conf);
+ }
+
+ /**
+ * Provides access to the Job tracking system of this location
+ *
+ * @return a {@link JobClient}
+ */
+ public JobClient getJobClient() throws IOException {
+ JobConf jconf = new JobConf(this.conf);
+ return new JobClient(jconf);
+ }
+
+ /*
+ * Listeners handling
+ */
+
+ protected void fireJarPublishDone(JarModule jar) {
+ for (IJobListener listener : jobListeners) {
+ listener.publishDone(jar);
+ }
+ }
+
+ protected void fireJarPublishStart(JarModule jar) {
+ for (IJobListener listener : jobListeners) {
+ listener.publishStart(jar);
+ }
+ }
+
+ protected void fireJobAdded(HadoopJob job) {
+ for (IJobListener listener : jobListeners) {
+ listener.jobAdded(job);
+ }
+ }
+
+ protected void fireJobRemoved(HadoopJob job) {
+ for (IJobListener listener : jobListeners) {
+ listener.jobRemoved(job);
+ }
+ }
+
+ protected void fireJobChanged(HadoopJob job) {
+ for (IJobListener listener : jobListeners) {
+ listener.jobChanged(job);
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/d7/d7d8bb84eb09cbb3d57193af99299372aad280c3.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/d7/d7d8bb84eb09cbb3d57193af99299372aad280c3.svn-base b/eclipse-plugin/.svn/pristine/d7/d7d8bb84eb09cbb3d57193af99299372aad280c3.svn-base
new file mode 100644
index 0000000..bea94d5
--- /dev/null
+++ b/eclipse-plugin/.svn/pristine/d7/d7d8bb84eb09cbb3d57193af99299372aad280c3.svn-base
@@ -0,0 +1,32 @@
+/**
+ * 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.hadoop.eclipse.dfs;
+
+/**
+ * Interface to define content entities in the DFS browser
+ */
+public interface DFSContent {
+
+ boolean hasChildren();
+
+ DFSContent[] getChildren();
+
+ void refresh();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/d8/d87ce33f9f39ca37b67251be51c19d69444fa542.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/d8/d87ce33f9f39ca37b67251be51c19d69444fa542.svn-base b/eclipse-plugin/.svn/pristine/d8/d87ce33f9f39ca37b67251be51c19d69444fa542.svn-base
new file mode 100644
index 0000000..b2d3c04
Binary files /dev/null and b/eclipse-plugin/.svn/pristine/d8/d87ce33f9f39ca37b67251be51c19d69444fa542.svn-base differ
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/d8/d881f9eba49fe1f282e0f71758fa8592006baf3b.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/d8/d881f9eba49fe1f282e0f71758fa8592006baf3b.svn-base b/eclipse-plugin/.svn/pristine/d8/d881f9eba49fe1f282e0f71758fa8592006baf3b.svn-base
new file mode 100644
index 0000000..6efa859
Binary files /dev/null and b/eclipse-plugin/.svn/pristine/d8/d881f9eba49fe1f282e0f71758fa8592006baf3b.svn-base differ
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/d9/d94bbb5bda0ca41ff350080e451e7a007b422924.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/d9/d94bbb5bda0ca41ff350080e451e7a007b422924.svn-base b/eclipse-plugin/.svn/pristine/d9/d94bbb5bda0ca41ff350080e451e7a007b422924.svn-base
new file mode 100644
index 0000000..9096b4c
Binary files /dev/null and b/eclipse-plugin/.svn/pristine/d9/d94bbb5bda0ca41ff350080e451e7a007b422924.svn-base differ
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/e0/e023932dcc8ef76ac559242fe1a6a4c555b8ee59.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/e0/e023932dcc8ef76ac559242fe1a6a4c555b8ee59.svn-base b/eclipse-plugin/.svn/pristine/e0/e023932dcc8ef76ac559242fe1a6a4c555b8ee59.svn-base
new file mode 100644
index 0000000..74641bb
--- /dev/null
+++ b/eclipse-plugin/.svn/pristine/e0/e023932dcc8ef76ac559242fe1a6a4c555b8ee59.svn-base
@@ -0,0 +1,34 @@
+/**
+ * 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.hadoop.eclipse.preferences;
+
+/**
+ * Constant definitions for plug-in preferences
+ */
+public class PreferenceConstants {
+
+ public static final String P_PATH = "pathPreference";
+
+ // public static final String P_BOOLEAN = "booleanPreference";
+ //
+ // public static final String P_CHOICE = "choicePreference";
+ //
+ // public static final String P_STRING = "stringPreference";
+ //
+}
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/e1/e172b041c626861ff26af3924b243670588190ad.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/e1/e172b041c626861ff26af3924b243670588190ad.svn-base b/eclipse-plugin/.svn/pristine/e1/e172b041c626861ff26af3924b243670588190ad.svn-base
new file mode 100644
index 0000000..df64c00
--- /dev/null
+++ b/eclipse-plugin/.svn/pristine/e1/e172b041c626861ff26af3924b243670588190ad.svn-base
@@ -0,0 +1,17 @@
+#Tue Aug 14 19:41:15 PDT 2007
+## Licensed 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.
+eclipse.preferences.version=1
+formatter_profile=_Lucene
+formatter_settings_version=11
+instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates/>
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/e3/e30bb9b81f942b5242d40c05e8e3cd8ab86ec06c.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/e3/e30bb9b81f942b5242d40c05e8e3cd8ab86ec06c.svn-base b/eclipse-plugin/.svn/pristine/e3/e30bb9b81f942b5242d40c05e8e3cd8ab86ec06c.svn-base
new file mode 100644
index 0000000..97dac5a
--- /dev/null
+++ b/eclipse-plugin/.svn/pristine/e3/e30bb9b81f942b5242d40c05e8e3cd8ab86ec06c.svn-base
@@ -0,0 +1,43 @@
+/**
+ * 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.hadoop.eclipse;
+
+import java.util.logging.Logger;
+
+/**
+ * Class to help with debugging properties
+ */
+public class PropertyTester extends
+ org.eclipse.core.expressions.PropertyTester {
+
+ static Logger log = Logger.getLogger(PropertyTester.class.getName());
+
+ public PropertyTester() {
+ }
+
+ public boolean test(Object receiver, String property, Object[] args,
+ Object expectedValue) {
+ log.fine("Test property " + property + ", " + receiver.getClass());
+
+ return true;
+
+ // todo(jz) support test for deployable if module has hadoop nature etc.
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/e4/e43b2bab19c15ec4f0c9bd3738dbbcc0c0c100f2.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/e4/e43b2bab19c15ec4f0c9bd3738dbbcc0c0c100f2.svn-base b/eclipse-plugin/.svn/pristine/e4/e43b2bab19c15ec4f0c9bd3738dbbcc0c0c100f2.svn-base
new file mode 100644
index 0000000..bdc0e70
--- /dev/null
+++ b/eclipse-plugin/.svn/pristine/e4/e43b2bab19c15ec4f0c9bd3738dbbcc0c0c100f2.svn-base
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+
+<!--
+ 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.
+-->
+
+<project default="jar" name="eclipse-plugin">
+
+ <import file="../build-contrib.xml"/>
+
+ <path id="eclipse-sdk-jars">
+ <fileset dir="${eclipse.home}/plugins/">
+ <include name="org.eclipse.ui*.jar"/>
+ <include name="org.eclipse.jdt*.jar"/>
+ <include name="org.eclipse.core*.jar"/>
+ <include name="org.eclipse.equinox*.jar"/>
+ <include name="org.eclipse.debug*.jar"/>
+ <include name="org.eclipse.osgi*.jar"/>
+ <include name="org.eclipse.swt*.jar"/>
+ <include name="org.eclipse.jface*.jar"/>
+
+ <include name="org.eclipse.team.cvs.ssh2*.jar"/>
+ <include name="com.jcraft.jsch*.jar"/>
+ </fileset>
+ </path>
+
+ <!-- Override classpath to include Eclipse SDK jars -->
+ <path id="classpath">
+ <pathelement location="${build.classes}"/>
+ <pathelement location="${hadoop.root}/build/classes"/>
+ <path refid="eclipse-sdk-jars"/>
+ <path refid="contrib-classpath"/>
+ </path>
+
+ <!-- Skip building if eclipse.home is unset. -->
+ <target name="check-contrib" unless="eclipse.home">
+ <property name="skip.contrib" value="yes"/>
+ <echo message="eclipse.home unset: skipping eclipse plugin"/>
+ </target>
+
+ <target name="compile" depends="init, ivy-retrieve-common" unless="skip.contrib">
+ <echo message="contrib: ${name} "/>
+ <javac
+ encoding="${build.encoding}"
+ srcdir="${src.dir}"
+ includes="**/*.java"
+ destdir="${build.classes}"
+ debug="${javac.debug}"
+ deprecation="${javac.deprecation}">
+ <classpath refid="classpath"/>
+ </javac>
+ </target>
+
+ <!-- Override jar target to specify manifest -->
+ <target name="jar" depends="compile" unless="skip.contrib">
+ <mkdir dir="${build.dir}/lib"/>
+ <copy tofile="${build.dir}/lib/hadoop-common.jar">
+ <fileset dir="${hadoop.root}/build/ivy/lib/Hadoop/common" includes="hadoop-common-*.jar" excludes="hadoop-common-*tests.jar"/>
+ </copy>
+ <copy file="${hadoop.root}/build/ivy/lib/Hadoop/common/commons-cli-${commons-cli.version}.jar" todir="${build.dir}/lib" verbose="true"/>
+ <jar
+ jarfile="${build.dir}/hadoop-${version}-${name}.jar"
+ manifest="${root}/META-INF/MANIFEST.MF">
+ <fileset dir="${build.dir}" includes="classes/ lib/"/>
+ <fileset dir="${root}" includes="resources/ plugin.xml"/>
+ </jar>
+ </target>
+
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/e5/e587cd5b8ba255295fad24109c27f7558045faf2.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/e5/e587cd5b8ba255295fad24109c27f7558045faf2.svn-base b/eclipse-plugin/.svn/pristine/e5/e587cd5b8ba255295fad24109c27f7558045faf2.svn-base
new file mode 100644
index 0000000..d563edb
Binary files /dev/null and b/eclipse-plugin/.svn/pristine/e5/e587cd5b8ba255295fad24109c27f7558045faf2.svn-base differ
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/ea/ea5d3e9bf2a424ec940fb098534ed0113ee1cf50.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/ea/ea5d3e9bf2a424ec940fb098534ed0113ee1cf50.svn-base b/eclipse-plugin/.svn/pristine/ea/ea5d3e9bf2a424ec940fb098534ed0113ee1cf50.svn-base
new file mode 100644
index 0000000..71cb60d
Binary files /dev/null and b/eclipse-plugin/.svn/pristine/ea/ea5d3e9bf2a424ec940fb098534ed0113ee1cf50.svn-base differ
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/ef/eff5f8749e7ae7fa23c8545fd80b2632ac15b506.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/ef/eff5f8749e7ae7fa23c8545fd80b2632ac15b506.svn-base b/eclipse-plugin/.svn/pristine/ef/eff5f8749e7ae7fa23c8545fd80b2632ac15b506.svn-base
new file mode 100644
index 0000000..aa19bf7
Binary files /dev/null and b/eclipse-plugin/.svn/pristine/ef/eff5f8749e7ae7fa23c8545fd80b2632ac15b506.svn-base differ
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/f4/f43b781028c2e206225de66ecb33fc4cd32f4e32.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/f4/f43b781028c2e206225de66ecb33fc4cd32f4e32.svn-base b/eclipse-plugin/.svn/pristine/f4/f43b781028c2e206225de66ecb33fc4cd32f4e32.svn-base
new file mode 100644
index 0000000..b23c4ec
Binary files /dev/null and b/eclipse-plugin/.svn/pristine/f4/f43b781028c2e206225de66ecb33fc4cd32f4e32.svn-base differ
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/f5/f52469c44c48d553fcb81db26dc29a55a4040dca.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/f5/f52469c44c48d553fcb81db26dc29a55a4040dca.svn-base b/eclipse-plugin/.svn/pristine/f5/f52469c44c48d553fcb81db26dc29a55a4040dca.svn-base
new file mode 100644
index 0000000..13ca6c6
--- /dev/null
+++ b/eclipse-plugin/.svn/pristine/f5/f52469c44c48d553fcb81db26dc29a55a4040dca.svn-base
@@ -0,0 +1,411 @@
+/**
+ * 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.hadoop.eclipse;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.lang.reflect.InvocationTargetException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.apache.hadoop.eclipse.preferences.MapReducePreferencePage;
+import org.apache.hadoop.eclipse.preferences.PreferenceConstants;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExecutableExtension;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.jdt.ui.wizards.NewJavaProjectWizardPage;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.preference.PreferenceDialog;
+import org.eclipse.jface.preference.PreferenceManager;
+import org.eclipse.jface.preference.PreferenceNode;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Link;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchWizard;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
+import org.eclipse.ui.wizards.newresource.BasicNewProjectResourceWizard;
+
+/**
+ * Wizard for creating a new MapReduce Project
+ *
+ */
+
+public class NewMapReduceProjectWizard extends Wizard implements
+ IWorkbenchWizard, IExecutableExtension {
+ static Logger log =
+ Logger.getLogger(NewMapReduceProjectWizard.class.getName());
+
+ private HadoopFirstPage firstPage;
+
+ private NewJavaProjectWizardPage javaPage;
+
+ public NewDriverWizardPage newDriverPage;
+
+ private IConfigurationElement config;
+
+ public NewMapReduceProjectWizard() {
+ setWindowTitle("New MapReduce Project Wizard");
+ }
+
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+
+ }
+
+ @Override
+ public boolean canFinish() {
+ return firstPage.isPageComplete() && javaPage.isPageComplete()
+ // && ((!firstPage.generateDriver.getSelection())
+ // || newDriverPage.isPageComplete()
+ ;
+ }
+
+ @Override
+ public IWizardPage getNextPage(IWizardPage page) {
+ // if (page == firstPage
+ // && firstPage.generateDriver.getSelection()
+ // )
+ // {
+ // return newDriverPage; // if "generate mapper" checked, second page is
+ // new driver page
+ // }
+ // else
+ // {
+ IWizardPage answer = super.getNextPage(page);
+ if (answer == newDriverPage) {
+ return null; // dont flip to new driver page unless "generate
+ // driver" is checked
+ } else if (answer == javaPage) {
+ return answer;
+ } else {
+ return answer;
+ }
+ // }
+ }
+
+ @Override
+ public IWizardPage getPreviousPage(IWizardPage page) {
+ if (page == newDriverPage) {
+ return firstPage; // newDriverPage, if it appears, is the second
+ // page
+ } else {
+ return super.getPreviousPage(page);
+ }
+ }
+
+ static class HadoopFirstPage extends WizardNewProjectCreationPage
+ implements SelectionListener {
+ public HadoopFirstPage() {
+ super("New Hadoop Project");
+ setImageDescriptor(ImageLibrary.get("wizard.mapreduce.project.new"));
+ }
+
+ private Link openPreferences;
+
+ private Button workspaceHadoop;
+
+ private Button projectHadoop;
+
+ private Text location;
+
+ private Button browse;
+
+ private String path;
+
+ public String currentPath;
+
+ // private Button generateDriver;
+
+ @Override
+ public void createControl(Composite parent) {
+ super.createControl(parent);
+
+ setTitle("MapReduce Project");
+ setDescription("Create a MapReduce project.");
+
+ Group group = new Group((Composite) getControl(), SWT.NONE);
+ group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ group.setText("Hadoop MapReduce Library Installation Path");
+ GridLayout layout = new GridLayout(3, true);
+ layout.marginLeft =
+ convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
+ layout.marginRight =
+ convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
+ layout.marginTop =
+ convertHorizontalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
+ layout.marginBottom =
+ convertHorizontalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
+ group.setLayout(layout);
+
+ workspaceHadoop = new Button(group, SWT.RADIO);
+ GridData d =
+ new GridData(GridData.BEGINNING, GridData.BEGINNING, false, false);
+ d.horizontalSpan = 2;
+ workspaceHadoop.setLayoutData(d);
+ // workspaceHadoop.setText("Use default workbench Hadoop library
+ // location");
+ workspaceHadoop.setSelection(true);
+
+ updateHadoopDirLabelFromPreferences();
+
+ openPreferences = new Link(group, SWT.NONE);
+ openPreferences
+ .setText("<a>Configure Hadoop install directory...</a>");
+ openPreferences.setLayoutData(new GridData(GridData.END,
+ GridData.CENTER, false, false));
+ openPreferences.addSelectionListener(this);
+
+ projectHadoop = new Button(group, SWT.RADIO);
+ projectHadoop.setLayoutData(new GridData(GridData.BEGINNING,
+ GridData.CENTER, false, false));
+ projectHadoop.setText("Specify Hadoop library location");
+
+ location = new Text(group, SWT.SINGLE | SWT.BORDER);
+ location.setText("");
+ d = new GridData(GridData.END, GridData.CENTER, true, false);
+ d.horizontalSpan = 1;
+ d.widthHint = 250;
+ d.grabExcessHorizontalSpace = true;
+ location.setLayoutData(d);
+ location.setEnabled(false);
+
+ browse = new Button(group, SWT.NONE);
+ browse.setText("Browse...");
+ browse.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER,
+ false, false));
+ browse.setEnabled(false);
+ browse.addSelectionListener(this);
+
+ projectHadoop.addSelectionListener(this);
+ workspaceHadoop.addSelectionListener(this);
+
+ // generateDriver = new Button((Composite) getControl(), SWT.CHECK);
+ // generateDriver.setText("Generate a MapReduce driver");
+ // generateDriver.addListener(SWT.Selection, new Listener()
+ // {
+ // public void handleEvent(Event event) {
+ // getContainer().updateButtons(); }
+ // });
+ }
+
+ @Override
+ public boolean isPageComplete() {
+ boolean validHadoop = validateHadoopLocation();
+
+ if (!validHadoop && isCurrentPage()) {
+ setErrorMessage("Invalid Hadoop Runtime specified; please click 'Configure Hadoop install directory' or fill in library location input field");
+ } else {
+ setErrorMessage(null);
+ }
+
+ return super.isPageComplete() && validHadoop;
+ }
+
+ private boolean validateHadoopLocation() {
+ FilenameFilter gotHadoopJar = new FilenameFilter() {
+ public boolean accept(File dir, String name) {
+ return (name.startsWith("hadoop") && name.endsWith(".jar")
+ && (name.indexOf("test") == -1) && (name.indexOf("examples") == -1));
+ }
+ };
+
+ if (workspaceHadoop.getSelection()) {
+ this.currentPath = path;
+ return new Path(path).toFile().exists()
+ && (new Path(path).toFile().list(gotHadoopJar).length > 0);
+ } else {
+ this.currentPath = location.getText();
+ File file = new Path(location.getText()).toFile();
+ return file.exists()
+ && (new Path(location.getText()).toFile().list(gotHadoopJar).length > 0);
+ }
+ }
+
+ private void updateHadoopDirLabelFromPreferences() {
+ path =
+ Activator.getDefault().getPreferenceStore().getString(
+ PreferenceConstants.P_PATH);
+
+ if ((path != null) && (path.length() > 0)) {
+ workspaceHadoop.setText("Use default Hadoop");
+ } else {
+ workspaceHadoop.setText("Use default Hadoop (currently not set)");
+ }
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ if (e.getSource() == openPreferences) {
+ PreferenceManager manager = new PreferenceManager();
+ manager.addToRoot(new PreferenceNode(
+ "Hadoop Installation Directory", new MapReducePreferencePage()));
+ PreferenceDialog dialog =
+ new PreferenceDialog(this.getShell(), manager);
+ dialog.create();
+ dialog.setMessage("Select Hadoop Installation Directory");
+ dialog.setBlockOnOpen(true);
+ dialog.open();
+
+ updateHadoopDirLabelFromPreferences();
+ } else if (e.getSource() == browse) {
+ DirectoryDialog dialog = new DirectoryDialog(this.getShell());
+ dialog
+ .setMessage("Select a hadoop installation, containing hadoop-X-core.jar");
+ dialog.setText("Select Hadoop Installation Directory");
+ String directory = dialog.open();
+
+ if (directory != null) {
+ location.setText(directory);
+
+ if (!validateHadoopLocation()) {
+ setErrorMessage("No Hadoop jar found in specified directory");
+ } else {
+ setErrorMessage(null);
+ }
+ }
+ } else if (projectHadoop.getSelection()) {
+ location.setEnabled(true);
+ browse.setEnabled(true);
+ } else {
+ location.setEnabled(false);
+ browse.setEnabled(false);
+ }
+
+ getContainer().updateButtons();
+ }
+ }
+
+ @Override
+ public void addPages() {
+ /*
+ * firstPage = new HadoopFirstPage(); addPage(firstPage ); addPage( new
+ * JavaProjectWizardSecondPage(firstPage) );
+ */
+
+ firstPage = new HadoopFirstPage();
+ javaPage =
+ new NewJavaProjectWizardPage(ResourcesPlugin.getWorkspace()
+ .getRoot(), firstPage);
+ // newDriverPage = new NewDriverWizardPage(false);
+ // newDriverPage.setPageComplete(false); // ensure finish button
+ // initially disabled
+ addPage(firstPage);
+ addPage(javaPage);
+
+ // addPage(newDriverPage);
+ }
+
+ @Override
+ public boolean performFinish() {
+ try {
+ PlatformUI.getWorkbench().getProgressService().runInUI(
+ this.getContainer(), new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor) {
+ try {
+ monitor.beginTask("Create Hadoop Project", 300);
+
+ javaPage.getRunnable().run(
+ new SubProgressMonitor(monitor, 100));
+
+ // if( firstPage.generateDriver.getSelection())
+ // {
+ // newDriverPage.setPackageFragmentRoot(javaPage.getNewJavaProject().getAllPackageFragmentRoots()[0],
+ // false);
+ // newDriverPage.getRunnable().run(new
+ // SubProgressMonitor(monitor,100));
+ // }
+
+ IProject project =
+ javaPage.getNewJavaProject().getResource().getProject();
+ IProjectDescription description = project.getDescription();
+ String[] existingNatures = description.getNatureIds();
+ String[] natures = new String[existingNatures.length + 1];
+ for (int i = 0; i < existingNatures.length; i++) {
+ natures[i + 1] = existingNatures[i];
+ }
+
+ natures[0] = MapReduceNature.ID;
+ description.setNatureIds(natures);
+
+ project.setPersistentProperty(new QualifiedName(
+ Activator.PLUGIN_ID, "hadoop.runtime.path"),
+ firstPage.currentPath);
+ project.setDescription(description,
+ new NullProgressMonitor());
+
+ String[] natureIds = project.getDescription().getNatureIds();
+ for (int i = 0; i < natureIds.length; i++) {
+ log.fine("Nature id # " + i + " > " + natureIds[i]);
+ }
+
+ monitor.worked(100);
+ monitor.done();
+
+ BasicNewProjectResourceWizard.updatePerspective(config);
+ } catch (CoreException e) {
+ // TODO Auto-generated catch block
+ log.log(Level.SEVERE, "CoreException thrown.", e);
+ } catch (InvocationTargetException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ }, null);
+ } catch (InvocationTargetException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ return true;
+ }
+
+ public void setInitializationData(IConfigurationElement config,
+ String propertyName, Object data) throws CoreException {
+ this.config = config;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/f6/f621ab56f3b42969266d6f0d60bd053c8ac57cf3.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/f6/f621ab56f3b42969266d6f0d60bd053c8ac57cf3.svn-base b/eclipse-plugin/.svn/pristine/f6/f621ab56f3b42969266d6f0d60bd053c8ac57cf3.svn-base
new file mode 100644
index 0000000..809525d
Binary files /dev/null and b/eclipse-plugin/.svn/pristine/f6/f621ab56f3b42969266d6f0d60bd053c8ac57cf3.svn-base differ
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/f7/f7e6e2945c57231cdcfad8a3a3b25bac390006cb.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/f7/f7e6e2945c57231cdcfad8a3a3b25bac390006cb.svn-base b/eclipse-plugin/.svn/pristine/f7/f7e6e2945c57231cdcfad8a3a3b25bac390006cb.svn-base
new file mode 100644
index 0000000..0c349c7
Binary files /dev/null and b/eclipse-plugin/.svn/pristine/f7/f7e6e2945c57231cdcfad8a3a3b25bac390006cb.svn-base differ
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/f8/f817795218da0fc1c67f6d43bd799fecb4d19a1a.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/f8/f817795218da0fc1c67f6d43bd799fecb4d19a1a.svn-base b/eclipse-plugin/.svn/pristine/f8/f817795218da0fc1c67f6d43bd799fecb4d19a1a.svn-base
new file mode 100644
index 0000000..fdfdcfb
--- /dev/null
+++ b/eclipse-plugin/.svn/pristine/f8/f817795218da0fc1c67f6d43bd799fecb4d19a1a.svn-base
@@ -0,0 +1,146 @@
+/**
+ * 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.hadoop.eclipse;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectNature;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+
+/**
+ * Class to configure and deconfigure an Eclipse project with the MapReduce
+ * project nature.
+ */
+
+public class MapReduceNature implements IProjectNature {
+
+ public static final String ID = "org.apache.hadoop.eclipse.Nature";
+
+ private IProject project;
+
+ static Logger log = Logger.getLogger(MapReduceNature.class.getName());
+
+ /**
+ * Configures an Eclipse project as a Map/Reduce project by adding the
+ * Hadoop libraries to a project's classpath.
+ */
+ public void configure() throws CoreException {
+ String path =
+ project.getPersistentProperty(new QualifiedName(Activator.PLUGIN_ID,
+ "hadoop.runtime.path"));
+
+ File dir = new File(path);
+ final ArrayList<File> coreJars = new ArrayList<File>();
+ dir.listFiles(new FileFilter() {
+ public boolean accept(File pathname) {
+ String fileName = pathname.getName();
+
+ // get the hadoop core jar without touching test or examples
+ // older version of hadoop don't use the word "core" -- eyhung
+ if ((fileName.indexOf("hadoop") != -1) && (fileName.endsWith("jar"))
+ && (fileName.indexOf("test") == -1)
+ && (fileName.indexOf("examples") == -1)) {
+ coreJars.add(pathname);
+ }
+
+ return false; // we don't care what this returns
+ }
+ });
+ File dir2 = new File(path + File.separatorChar + "lib");
+ if (dir2.exists() && dir2.isDirectory()) {
+ dir2.listFiles(new FileFilter() {
+ public boolean accept(File pathname) {
+ if ((!pathname.isDirectory())
+ && (pathname.getName().endsWith("jar"))) {
+ coreJars.add(pathname);
+ }
+
+ return false; // we don't care what this returns
+ }
+ });
+ }
+
+ // Add Hadoop libraries onto classpath
+ IJavaProject javaProject = JavaCore.create(getProject());
+ // Bundle bundle = Activator.getDefault().getBundle();
+ try {
+ IClasspathEntry[] currentCp = javaProject.getRawClasspath();
+ IClasspathEntry[] newCp =
+ new IClasspathEntry[currentCp.length + coreJars.size()];
+ System.arraycopy(currentCp, 0, newCp, 0, currentCp.length);
+
+ final Iterator<File> i = coreJars.iterator();
+ int count = 0;
+ while (i.hasNext()) {
+ // for (int i = 0; i < s_coreJarNames.length; i++) {
+
+ final File f = (File) i.next();
+ // URL url = FileLocator.toFileURL(FileLocator.find(bundle, new
+ // Path("lib/" + s_coreJarNames[i]), null));
+ URL url = f.toURI().toURL();
+ log.finer("hadoop library url.getPath() = " + url.getPath());
+
+ newCp[newCp.length - 1 - count] =
+ JavaCore.newLibraryEntry(new Path(url.getPath()), null, null);
+ count++;
+ }
+
+ javaProject.setRawClasspath(newCp, new NullProgressMonitor());
+ } catch (Exception e) {
+ log.log(Level.SEVERE, "IOException generated in "
+ + this.getClass().getCanonicalName(), e);
+ }
+ }
+
+ /**
+ * Deconfigure a project from MapReduce status. Currently unimplemented.
+ */
+ public void deconfigure() throws CoreException {
+ // TODO Auto-generated method stub
+ }
+
+ /**
+ * Returns the project to which this project nature applies.
+ */
+ public IProject getProject() {
+ return this.project;
+ }
+
+ /**
+ * Sets the project to which this nature applies. Used when instantiating
+ * this project nature runtime.
+ */
+ public void setProject(IProject project) {
+ this.project = project;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/f8/f8b083a69a21299c30664f4fc28222403e79df19.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/f8/f8b083a69a21299c30664f4fc28222403e79df19.svn-base b/eclipse-plugin/.svn/pristine/f8/f8b083a69a21299c30664f4fc28222403e79df19.svn-base
new file mode 100644
index 0000000..1668e29
--- /dev/null
+++ b/eclipse-plugin/.svn/pristine/f8/f8b083a69a21299c30664f4fc28222403e79df19.svn-base
@@ -0,0 +1,36 @@
+/**
+ * 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.hadoop.eclipse.server;
+
+/**
+ * Interface for updating/adding jobs to the MapReduce Server view.
+ */
+public interface IJobListener {
+
+ void jobChanged(HadoopJob job);
+
+ void jobAdded(HadoopJob job);
+
+ void jobRemoved(HadoopJob job);
+
+ void publishStart(JarModule jar);
+
+ void publishDone(JarModule jar);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/f8/f8cfaf230ada971477f03aa447612c515ec3a7d9.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/f8/f8cfaf230ada971477f03aa447612c515ec3a7d9.svn-base b/eclipse-plugin/.svn/pristine/f8/f8cfaf230ada971477f03aa447612c515ec3a7d9.svn-base
new file mode 100644
index 0000000..cc01595
Binary files /dev/null and b/eclipse-plugin/.svn/pristine/f8/f8cfaf230ada971477f03aa447612c515ec3a7d9.svn-base differ
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/a1719e04/eclipse-plugin/.svn/pristine/fb/fb058fe9c1ce08d0f0644f4422d79590db522868.svn-base
----------------------------------------------------------------------
diff --git a/eclipse-plugin/.svn/pristine/fb/fb058fe9c1ce08d0f0644f4422d79590db522868.svn-base b/eclipse-plugin/.svn/pristine/fb/fb058fe9c1ce08d0f0644f4422d79590db522868.svn-base
new file mode 100644
index 0000000..4a87cdf
Binary files /dev/null and b/eclipse-plugin/.svn/pristine/fb/fb058fe9c1ce08d0f0644f4422d79590db522868.svn-base differ