You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sqoop.apache.org by an...@apache.org on 2018/01/18 14:04:14 UTC
[28/32] sqoop git commit: SQOOP-3273: Removing com.cloudera.sqoop
packages
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/com/cloudera/sqoop/tool/SqoopTool.java
----------------------------------------------------------------------
diff --git a/src/java/com/cloudera/sqoop/tool/SqoopTool.java b/src/java/com/cloudera/sqoop/tool/SqoopTool.java
deleted file mode 100644
index 8a4735b..0000000
--- a/src/java/com/cloudera/sqoop/tool/SqoopTool.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * 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 com.cloudera.sqoop.tool;
-
-import java.util.Set;
-
-/**
- * @deprecated Moving to use org.apache.sqoop namespace.
- */
-public abstract class SqoopTool
- extends org.apache.sqoop.tool.SqoopTool {
-
- public static final String TOOL_PLUGINS_KEY =
- org.apache.sqoop.tool.SqoopTool.TOOL_PLUGINS_KEY;
-
- public static final Set<String> getToolNames() {
- return org.apache.sqoop.tool.SqoopTool.getToolNames();
- }
-
- public static final SqoopTool getTool(String toolName) {
- return (SqoopTool)org.apache.sqoop.tool.SqoopTool.getTool(toolName);
- }
-
- public static final String getToolDescription(String toolName) {
- return org.apache.sqoop.tool.SqoopTool.getToolDescription(toolName);
- }
-
- public SqoopTool() {
- super();
- }
-
- public SqoopTool(String name) {
- super(name);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/com/cloudera/sqoop/tool/ToolDesc.java
----------------------------------------------------------------------
diff --git a/src/java/com/cloudera/sqoop/tool/ToolDesc.java b/src/java/com/cloudera/sqoop/tool/ToolDesc.java
deleted file mode 100644
index 49e8274..0000000
--- a/src/java/com/cloudera/sqoop/tool/ToolDesc.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * 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 com.cloudera.sqoop.tool;
-
-/**
- * @deprecated Moving to use org.apache.sqoop namespace.
- */
-public class ToolDesc
- extends org.apache.sqoop.tool.ToolDesc {
-
- public ToolDesc(String name, Class<? extends SqoopTool> cls, String desc) {
- super(name, cls, desc);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/com/cloudera/sqoop/tool/ToolPlugin.java
----------------------------------------------------------------------
diff --git a/src/java/com/cloudera/sqoop/tool/ToolPlugin.java b/src/java/com/cloudera/sqoop/tool/ToolPlugin.java
deleted file mode 100644
index 46b69fb..0000000
--- a/src/java/com/cloudera/sqoop/tool/ToolPlugin.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * 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 com.cloudera.sqoop.tool;
-
-/**
- * @deprecated Moving to use org.apache.sqoop namespace.
- */
-public abstract class ToolPlugin
- extends org.apache.sqoop.tool.ToolPlugin {
-}
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/com/cloudera/sqoop/tool/VersionTool.java
----------------------------------------------------------------------
diff --git a/src/java/com/cloudera/sqoop/tool/VersionTool.java b/src/java/com/cloudera/sqoop/tool/VersionTool.java
deleted file mode 100644
index ab85b89..0000000
--- a/src/java/com/cloudera/sqoop/tool/VersionTool.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * 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 com.cloudera.sqoop.tool;
-
-/**
- * @deprecated Moving to use org.apache.sqoop namespace.
- */
-public class VersionTool
- extends org.apache.sqoop.tool.VersionTool {
-}
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/com/cloudera/sqoop/util/AppendUtils.java
----------------------------------------------------------------------
diff --git a/src/java/com/cloudera/sqoop/util/AppendUtils.java b/src/java/com/cloudera/sqoop/util/AppendUtils.java
deleted file mode 100644
index 0b9f887..0000000
--- a/src/java/com/cloudera/sqoop/util/AppendUtils.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * 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 com.cloudera.sqoop.util;
-
-import com.cloudera.sqoop.manager.ImportJobContext;
-
-/**
- * @deprecated Moving to use org.apache.sqoop namespace.
- */
-public class AppendUtils
- extends org.apache.sqoop.util.AppendUtils {
-
- public AppendUtils(ImportJobContext context) {
- super(context);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/com/cloudera/sqoop/util/AsyncSink.java
----------------------------------------------------------------------
diff --git a/src/java/com/cloudera/sqoop/util/AsyncSink.java b/src/java/com/cloudera/sqoop/util/AsyncSink.java
deleted file mode 100644
index 1a869ba..0000000
--- a/src/java/com/cloudera/sqoop/util/AsyncSink.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * 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 com.cloudera.sqoop.util;
-
-/**
- * @deprecated Moving to use org.apache.sqoop namespace.
- */
-public abstract class AsyncSink
- extends org.apache.sqoop.util.AsyncSink {
-}
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/com/cloudera/sqoop/util/ClassLoaderStack.java
----------------------------------------------------------------------
diff --git a/src/java/com/cloudera/sqoop/util/ClassLoaderStack.java b/src/java/com/cloudera/sqoop/util/ClassLoaderStack.java
deleted file mode 100644
index fcec0ce..0000000
--- a/src/java/com/cloudera/sqoop/util/ClassLoaderStack.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * 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 com.cloudera.sqoop.util;
-
-import java.io.IOException;
-
-/**
- * @deprecated Moving to use org.apache.sqoop namespace.
- */
-public final class ClassLoaderStack {
-
- private ClassLoaderStack() { }
-
- public static void setCurrentClassLoader(ClassLoader cl) {
- org.apache.sqoop.util.ClassLoaderStack.setCurrentClassLoader(cl);
- }
-
- public static ClassLoader addJarFile(String jarFile, String testClassName)
- throws IOException {
- return org.apache.sqoop.util.ClassLoaderStack.addJarFile(jarFile,
- testClassName);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/com/cloudera/sqoop/util/DirectImportUtils.java
----------------------------------------------------------------------
diff --git a/src/java/com/cloudera/sqoop/util/DirectImportUtils.java b/src/java/com/cloudera/sqoop/util/DirectImportUtils.java
deleted file mode 100644
index 9b84748..0000000
--- a/src/java/com/cloudera/sqoop/util/DirectImportUtils.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * 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 com.cloudera.sqoop.util;
-
-import java.io.File;
-import java.io.IOException;
-
-import org.apache.hadoop.conf.Configuration;
-
-import com.cloudera.sqoop.SqoopOptions;
-import com.cloudera.sqoop.io.SplittableBufferedWriter;
-import com.cloudera.sqoop.manager.ImportJobContext;
-
-/**
- * @deprecated Moving to use org.apache.sqoop namespace.
- */
-public final class DirectImportUtils {
-
- private DirectImportUtils() { }
-
- public static void setFilePermissions(File file, String modstr)
- throws IOException {
- org.apache.sqoop.util.DirectImportUtils.setFilePermissions(file, modstr);
- }
-
- public static SplittableBufferedWriter createHdfsSink(Configuration conf,
- SqoopOptions options, ImportJobContext context) throws IOException {
- return org.apache.sqoop.util.DirectImportUtils.createHdfsSink(conf,
- options, context);
- }
-
- public static boolean isLocalhost(String someHost) {
- return org.apache.sqoop.util.DirectImportUtils.isLocalhost(someHost);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/com/cloudera/sqoop/util/ErrorableAsyncSink.java
----------------------------------------------------------------------
diff --git a/src/java/com/cloudera/sqoop/util/ErrorableAsyncSink.java b/src/java/com/cloudera/sqoop/util/ErrorableAsyncSink.java
deleted file mode 100644
index 4af8d72..0000000
--- a/src/java/com/cloudera/sqoop/util/ErrorableAsyncSink.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * 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 com.cloudera.sqoop.util;
-
-/**
- * @deprecated Moving to use org.apache.sqoop namespace.
- */
-public abstract class ErrorableAsyncSink
- extends org.apache.sqoop.util.ErrorableAsyncSink {
-}
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/com/cloudera/sqoop/util/ErrorableThread.java
----------------------------------------------------------------------
diff --git a/src/java/com/cloudera/sqoop/util/ErrorableThread.java b/src/java/com/cloudera/sqoop/util/ErrorableThread.java
deleted file mode 100644
index 6cde23a..0000000
--- a/src/java/com/cloudera/sqoop/util/ErrorableThread.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * 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 com.cloudera.sqoop.util;
-
-/**
- * @deprecated Moving to use org.apache.sqoop namespace.
- */
-public abstract class ErrorableThread
- extends org.apache.sqoop.util.ErrorableThread {
-}
-
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/com/cloudera/sqoop/util/Executor.java
----------------------------------------------------------------------
diff --git a/src/java/com/cloudera/sqoop/util/Executor.java b/src/java/com/cloudera/sqoop/util/Executor.java
deleted file mode 100644
index 366a2fa..0000000
--- a/src/java/com/cloudera/sqoop/util/Executor.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * 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 com.cloudera.sqoop.util;
-
-import java.io.IOException;
-import java.util.List;
-
-import org.apache.sqoop.util.AsyncSink;
-
-/**
- * @deprecated Moving to use org.apache.sqoop namespace.
- */
-public final class Executor {
-
- private Executor() { }
-
- public static int exec(String [] args) throws IOException {
- return org.apache.sqoop.util.Executor.exec(args);
- }
-
- public static int exec(String [] args, AsyncSink outSink,
- AsyncSink errSink) throws IOException {
- return org.apache.sqoop.util.Executor.exec(args, outSink, errSink);
- }
-
- public static int exec(String [] args, String [] envp, AsyncSink outSink,
- AsyncSink errSink) throws IOException {
- return org.apache.sqoop.util.Executor.exec(args, envp, outSink, errSink);
- }
-
- public static List<String> getCurEnvpStrings() {
- return org.apache.sqoop.util.Executor.getCurEnvpStrings();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/com/cloudera/sqoop/util/ExitSecurityException.java
----------------------------------------------------------------------
diff --git a/src/java/com/cloudera/sqoop/util/ExitSecurityException.java b/src/java/com/cloudera/sqoop/util/ExitSecurityException.java
deleted file mode 100644
index e9ec464..0000000
--- a/src/java/com/cloudera/sqoop/util/ExitSecurityException.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * 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 com.cloudera.sqoop.util;
-
-/**
- * @deprecated Moving to use org.apache.sqoop namespace.
- */
-@SuppressWarnings("serial")
-public class ExitSecurityException
- extends org.apache.sqoop.util.ExitSecurityException {
-
- public ExitSecurityException() {
- super();
- }
-
- public ExitSecurityException(final String message) {
- super(message);
- }
-
- public ExitSecurityException(int status) {
- super(status);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/com/cloudera/sqoop/util/ExportException.java
----------------------------------------------------------------------
diff --git a/src/java/com/cloudera/sqoop/util/ExportException.java b/src/java/com/cloudera/sqoop/util/ExportException.java
deleted file mode 100644
index 6c86795..0000000
--- a/src/java/com/cloudera/sqoop/util/ExportException.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * 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 com.cloudera.sqoop.util;
-
-/**
- * @deprecated Moving to use org.apache.sqoop namespace.
- */
-@SuppressWarnings("serial")
-public class ExportException
- extends org.apache.sqoop.util.ExportException {
-
- public ExportException() {
- super();
- }
-
- public ExportException(final String message) {
- super(message);
- }
-
- public ExportException(final Throwable cause) {
- super(cause);
- }
-
- public ExportException(final String message, final Throwable cause) {
- super(message, cause);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/com/cloudera/sqoop/util/FileListing.java
----------------------------------------------------------------------
diff --git a/src/java/com/cloudera/sqoop/util/FileListing.java b/src/java/com/cloudera/sqoop/util/FileListing.java
deleted file mode 100644
index 12494d8..0000000
--- a/src/java/com/cloudera/sqoop/util/FileListing.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * 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 com.cloudera.sqoop.util;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.util.List;
-
-/**
- * @deprecated Moving to use org.apache.sqoop namespace.
- */
-public final class FileListing {
-
- private FileListing() { }
-
- public static void main(String... aArgs) throws FileNotFoundException {
- org.apache.sqoop.util.FileListing.main(aArgs);
- }
-
- public static List<File> getFileListing(File aStartingDir)
- throws FileNotFoundException {
- return org.apache.sqoop.util.FileListing.getFileListing(aStartingDir);
- }
-
- public static void recursiveDeleteDir(File dir) throws IOException {
- org.apache.sqoop.util.FileListing.recursiveDeleteDir(dir);
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/com/cloudera/sqoop/util/ImportException.java
----------------------------------------------------------------------
diff --git a/src/java/com/cloudera/sqoop/util/ImportException.java b/src/java/com/cloudera/sqoop/util/ImportException.java
deleted file mode 100644
index 34e6767..0000000
--- a/src/java/com/cloudera/sqoop/util/ImportException.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * 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 com.cloudera.sqoop.util;
-
-/**
- * @deprecated Moving to use org.apache.sqoop namespace.
- */
-@SuppressWarnings("serial")
-public class ImportException
- extends org.apache.sqoop.util.ImportException {
-
- public ImportException() {
- super();
- }
-
- public ImportException(final String message) {
- super(message);
- }
-
- public ImportException(final Throwable cause) {
- super(cause);
- }
-
- public ImportException(final String message, final Throwable cause) {
- super(message, cause);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/com/cloudera/sqoop/util/Jars.java
----------------------------------------------------------------------
diff --git a/src/java/com/cloudera/sqoop/util/Jars.java b/src/java/com/cloudera/sqoop/util/Jars.java
deleted file mode 100644
index 09a4f16..0000000
--- a/src/java/com/cloudera/sqoop/util/Jars.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * 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 com.cloudera.sqoop.util;
-
-import com.cloudera.sqoop.manager.ConnManager;
-
-/**
- * @deprecated Moving to use org.apache.sqoop namespace.
- */
-public final class Jars {
-
- private Jars() { }
-
- public static String getSqoopJarPath() {
- return org.apache.sqoop.util.Jars.getSqoopJarPath();
- }
-
- public static String getJarPathForClass(Class<? extends Object> classObj) {
- return org.apache.sqoop.util.Jars.getJarPathForClass(classObj);
- }
-
- public static String getDriverClassJar(ConnManager mgr) {
- return org.apache.sqoop.util.Jars.getDriverClassJar(mgr);
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/com/cloudera/sqoop/util/JdbcUrl.java
----------------------------------------------------------------------
diff --git a/src/java/com/cloudera/sqoop/util/JdbcUrl.java b/src/java/com/cloudera/sqoop/util/JdbcUrl.java
deleted file mode 100644
index f7ef10b..0000000
--- a/src/java/com/cloudera/sqoop/util/JdbcUrl.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * 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 com.cloudera.sqoop.util;
-
-/**
- * @deprecated Moving to use org.apache.sqoop namespace.
- */
-public final class JdbcUrl {
-
- private JdbcUrl() { }
-
- public static String getDatabaseName(String connectString) {
- return org.apache.sqoop.util.JdbcUrl.getDatabaseName(connectString);
- }
-
- public static String getHostName(String connectString) {
- return org.apache.sqoop.util.JdbcUrl.getHostName(connectString);
- }
-
- public static int getPort(String connectString) {
- return org.apache.sqoop.util.JdbcUrl.getPort(connectString);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/com/cloudera/sqoop/util/LoggingAsyncSink.java
----------------------------------------------------------------------
diff --git a/src/java/com/cloudera/sqoop/util/LoggingAsyncSink.java b/src/java/com/cloudera/sqoop/util/LoggingAsyncSink.java
deleted file mode 100644
index 9699252..0000000
--- a/src/java/com/cloudera/sqoop/util/LoggingAsyncSink.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * 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 com.cloudera.sqoop.util;
-
-import org.apache.commons.logging.Log;
-
-/**
- * @deprecated Moving to use org.apache.sqoop namespace.
- */
-public class LoggingAsyncSink
- extends org.apache.sqoop.util.LoggingAsyncSink {
-
- public LoggingAsyncSink(final Log context) {
- super(context);
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/com/cloudera/sqoop/util/LoggingUtils.java
----------------------------------------------------------------------
diff --git a/src/java/com/cloudera/sqoop/util/LoggingUtils.java b/src/java/com/cloudera/sqoop/util/LoggingUtils.java
deleted file mode 100644
index 9cd50ff..0000000
--- a/src/java/com/cloudera/sqoop/util/LoggingUtils.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * 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 com.cloudera.sqoop.util;
-
-import java.sql.SQLException;
-
-import org.apache.commons.logging.Log;
-
-/**
- * @deprecated Moving to use org.apache.sqoop namespace.
- */
-public final class LoggingUtils {
-
- private LoggingUtils() { }
-
- public static void logAll(Log log, SQLException e) {
- org.apache.sqoop.util.LoggingUtils.logAll(log, e);
- }
-}
-
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/com/cloudera/sqoop/util/NullAsyncSink.java
----------------------------------------------------------------------
diff --git a/src/java/com/cloudera/sqoop/util/NullAsyncSink.java b/src/java/com/cloudera/sqoop/util/NullAsyncSink.java
deleted file mode 100644
index 7d607d5..0000000
--- a/src/java/com/cloudera/sqoop/util/NullAsyncSink.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * 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 com.cloudera.sqoop.util;
-
-/**
- * @deprecated Moving to use org.apache.sqoop namespace.
- */
-public class NullAsyncSink
- extends org.apache.sqoop.util.NullAsyncSink {
-}
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/com/cloudera/sqoop/util/OptionsFileUtil.java
----------------------------------------------------------------------
diff --git a/src/java/com/cloudera/sqoop/util/OptionsFileUtil.java b/src/java/com/cloudera/sqoop/util/OptionsFileUtil.java
deleted file mode 100644
index 6c6cacd..0000000
--- a/src/java/com/cloudera/sqoop/util/OptionsFileUtil.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * 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 com.cloudera.sqoop.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @deprecated Moving to use org.apache.sqoop namespace.
- */
-public final class OptionsFileUtil {
-
- private OptionsFileUtil() { }
-
- public static String[] expandArguments(String[] args) throws Exception {
- List<String> options = new ArrayList<String>();
- return org.apache.sqoop.util.OptionsFileUtil.expandArguments(args);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/com/cloudera/sqoop/util/PerfCounters.java
----------------------------------------------------------------------
diff --git a/src/java/com/cloudera/sqoop/util/PerfCounters.java b/src/java/com/cloudera/sqoop/util/PerfCounters.java
deleted file mode 100644
index a8460dd..0000000
--- a/src/java/com/cloudera/sqoop/util/PerfCounters.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * 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 com.cloudera.sqoop.util;
-
-/**
- * @deprecated Moving to use org.apache.sqoop namespace.
- */
-public class PerfCounters
- extends org.apache.sqoop.util.PerfCounters {
-
- public PerfCounters() {
- super();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/com/cloudera/sqoop/util/RandomHash.java
----------------------------------------------------------------------
diff --git a/src/java/com/cloudera/sqoop/util/RandomHash.java b/src/java/com/cloudera/sqoop/util/RandomHash.java
deleted file mode 100644
index d3ba497..0000000
--- a/src/java/com/cloudera/sqoop/util/RandomHash.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * 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 com.cloudera.sqoop.util;
-
-/**
- * @deprecated Moving to use org.apache.sqoop namespace.
- */
-public final class RandomHash {
-
- private RandomHash() { }
-
- public static byte [] generateMD5Bytes() {
- return org.apache.sqoop.util.RandomHash.generateMD5Bytes();
- }
-
- public static String generateMD5String() {
- return org.apache.sqoop.util.RandomHash.generateMD5String();
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/com/cloudera/sqoop/util/ResultSetPrinter.java
----------------------------------------------------------------------
diff --git a/src/java/com/cloudera/sqoop/util/ResultSetPrinter.java b/src/java/com/cloudera/sqoop/util/ResultSetPrinter.java
deleted file mode 100644
index 4dc9c72..0000000
--- a/src/java/com/cloudera/sqoop/util/ResultSetPrinter.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * 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 com.cloudera.sqoop.util;
-
-/**
- * @deprecated Moving to use org.apache.sqoop namespace.
- */
-public class ResultSetPrinter
- extends org.apache.sqoop.util.ResultSetPrinter {
-}
-
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/com/cloudera/sqoop/util/StoredAsProperty.java
----------------------------------------------------------------------
diff --git a/src/java/com/cloudera/sqoop/util/StoredAsProperty.java b/src/java/com/cloudera/sqoop/util/StoredAsProperty.java
deleted file mode 100644
index eebfcda..0000000
--- a/src/java/com/cloudera/sqoop/util/StoredAsProperty.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * 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 com.cloudera.sqoop.util;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * @deprecated Moving to use org.apache.sqoop namespace.
- */
-@Documented
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.FIELD)
-public @interface StoredAsProperty {
- String value();
-}
-
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/com/cloudera/sqoop/util/SubprocessSecurityManager.java
----------------------------------------------------------------------
diff --git a/src/java/com/cloudera/sqoop/util/SubprocessSecurityManager.java b/src/java/com/cloudera/sqoop/util/SubprocessSecurityManager.java
deleted file mode 100644
index 787564a..0000000
--- a/src/java/com/cloudera/sqoop/util/SubprocessSecurityManager.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * 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 com.cloudera.sqoop.util;
-
-/**
- * @deprecated Moving to use org.apache.sqoop namespace.
- */
-public class SubprocessSecurityManager
- extends org.apache.sqoop.util.SubprocessSecurityManager {
-
- public SubprocessSecurityManager() {
- super();
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/com/cloudera/sqoop/util/TaskId.java
----------------------------------------------------------------------
diff --git a/src/java/com/cloudera/sqoop/util/TaskId.java b/src/java/com/cloudera/sqoop/util/TaskId.java
deleted file mode 100644
index 7804c8e..0000000
--- a/src/java/com/cloudera/sqoop/util/TaskId.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * 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 com.cloudera.sqoop.util;
-
-import java.io.File;
-import java.io.IOException;
-
-import org.apache.hadoop.conf.Configuration;
-
-/**
- * @deprecated Moving to use org.apache.sqoop namespace.
- */
-public final class TaskId {
-
- private TaskId() { }
-
- public static String get(Configuration conf, String defaultVal) {
- return org.apache.sqoop.util.TaskId.get(conf, defaultVal);
- }
-
- public static File getLocalWorkPath(Configuration conf) throws IOException {
- return org.apache.sqoop.util.TaskId.getLocalWorkPath(conf);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/org/apache/sqoop/ConnFactory.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/ConnFactory.java b/src/java/org/apache/sqoop/ConnFactory.java
index 3f77252..b008dfe 100644
--- a/src/java/org/apache/sqoop/ConnFactory.java
+++ b/src/java/org/apache/sqoop/ConnFactory.java
@@ -36,12 +36,12 @@ import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.util.ReflectionUtils;
import org.apache.hadoop.util.StringUtils;
-import com.cloudera.sqoop.manager.ConnManager;
-import com.cloudera.sqoop.manager.DefaultManagerFactory;
-import com.cloudera.sqoop.manager.ManagerFactory;
-import com.cloudera.sqoop.metastore.JobData;
+import org.apache.sqoop.manager.ConnManager;
+import org.apache.sqoop.manager.DefaultManagerFactory;
+import org.apache.sqoop.manager.ManagerFactory;
+import org.apache.sqoop.metastore.JobData;
-import com.cloudera.sqoop.util.ClassLoaderStack;
+import org.apache.sqoop.util.ClassLoaderStack;
import org.apache.sqoop.manager.GenericJdbcManager;
import org.apache.sqoop.manager.oracle.OraOopManagerFactory;
@@ -119,7 +119,7 @@ public class ConnFactory {
* @throws IOException if it cannot find a ConnManager for this schema.
*/
public ConnManager getManager(JobData data) throws IOException {
- com.cloudera.sqoop.SqoopOptions options = data.getSqoopOptions();
+ SqoopOptions options = data.getSqoopOptions();
String manualDriver = options.getDriverClassName();
String managerClassName = options.getConnManagerClassName();
@@ -151,12 +151,11 @@ public class ConnFactory {
// connectors are forcing to use their building class names.
if (manualDriver == null) {
Constructor<ConnManager> constructor =
- cls.getDeclaredConstructor(com.cloudera.sqoop.SqoopOptions.class);
+ cls.getDeclaredConstructor(SqoopOptions.class);
connManager = constructor.newInstance(options);
} else {
Constructor<ConnManager> constructor =
- cls.getDeclaredConstructor(String.class,
- com.cloudera.sqoop.SqoopOptions.class);
+ cls.getDeclaredConstructor(String.class, SqoopOptions.class);
connManager = constructor.newInstance(manualDriver, options);
}
} catch (ClassNotFoundException e) {
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/org/apache/sqoop/Sqoop.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/Sqoop.java b/src/java/org/apache/sqoop/Sqoop.java
index 8764aff..08ff82c 100644
--- a/src/java/org/apache/sqoop/Sqoop.java
+++ b/src/java/org/apache/sqoop/Sqoop.java
@@ -28,22 +28,20 @@ import org.apache.hadoop.conf.Configured;
import org.apache.hadoop.util.Tool;
import org.apache.hadoop.util.ToolRunner;
-import com.cloudera.sqoop.SqoopOptions;
-import com.cloudera.sqoop.cli.ToolOptions;
-import com.cloudera.sqoop.tool.SqoopTool;
-import com.cloudera.sqoop.util.OptionsFileUtil;
+import org.apache.sqoop.tool.SqoopTool;
+import org.apache.sqoop.util.OptionsFileUtil;
-import static com.cloudera.sqoop.SqoopOptions.isSqoopRethrowSystemPropertySet;
+import static org.apache.sqoop.SqoopOptions.isSqoopRethrowSystemPropertySet;
import static org.apache.sqoop.tool.BaseSqoopTool.THROW_ON_ERROR_ARG;
/**
* Main entry-point for Sqoop
- * Usage: hadoop jar (this_jar_name) com.cloudera.sqoop.Sqoop (options)
+ * Usage: hadoop jar (this_jar_name) org.apache.sqoop.Sqoop (options)
* See the SqoopOptions class for options.
*/
public class Sqoop extends Configured implements Tool {
- public static final Log SQOOP_LOG = LogFactory.getLog("com.cloudera.sqoop");
+ public static final Log SQOOP_LOG = LogFactory.getLog("org.apache.sqoop");
public static final Log LOG = LogFactory.getLog(Sqoop.class.getName());
/**
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/org/apache/sqoop/SqoopOptions.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/SqoopOptions.java b/src/java/org/apache/sqoop/SqoopOptions.java
index d18141c..73d0757 100644
--- a/src/java/org/apache/sqoop/SqoopOptions.java
+++ b/src/java/org/apache/sqoop/SqoopOptions.java
@@ -45,14 +45,11 @@ import org.apache.sqoop.validation.AbortOnFailureHandler;
import org.apache.sqoop.validation.AbsoluteValidationThreshold;
import org.apache.sqoop.validation.RowCountValidator;
-import com.cloudera.sqoop.SqoopOptions.FileLayout;
-import com.cloudera.sqoop.SqoopOptions.IncrementalMode;
-import com.cloudera.sqoop.SqoopOptions.UpdateMode;
-import com.cloudera.sqoop.lib.DelimiterSet;
-import com.cloudera.sqoop.lib.LargeObjectLoader;
-import com.cloudera.sqoop.tool.SqoopTool;
-import com.cloudera.sqoop.util.RandomHash;
-import com.cloudera.sqoop.util.StoredAsProperty;
+import org.apache.sqoop.lib.DelimiterSet;
+import org.apache.sqoop.lib.LargeObjectLoader;
+import org.apache.sqoop.tool.SqoopTool;
+import org.apache.sqoop.util.RandomHash;
+import org.apache.sqoop.util.StoredAsProperty;
import static org.apache.sqoop.Sqoop.SQOOP_RETHROW_PROPERTY;
import static org.apache.sqoop.orm.ClassWriter.toJavaIdentifier;
@@ -83,6 +80,44 @@ public class SqoopOptions implements Cloneable {
public static final boolean METASTORE_PASSWORD_DEFAULT = false;
public static final String DB_PASSWORD_KEY = "db.password";
+ /** Selects in-HDFS destination file format. */
+ public enum FileLayout {
+ TextFile,
+ SequenceFile,
+ AvroDataFile,
+ ParquetFile
+ }
+
+ /**
+ * Incremental imports support two modes:
+ * <ul>
+ * <li>new rows being appended to the end of a table with an
+ * incrementing id</li>
+ * <li>new data results in a date-last-modified column being
+ * updated to NOW(); Sqoop will pull all dirty rows in the next
+ * incremental import.</li>
+ * </ul>
+ */
+ public enum IncrementalMode {
+ None,
+ AppendRows,
+ DateLastModified,
+ }
+
+ /**
+ * Update mode option specifies how updates are performed when
+ * new rows are found with non-matching keys in database.
+ * It supports two modes:
+ * <ul>
+ * <li>UpdateOnly: This is the default. New rows are silently ignored.</li>
+ * <li>AllowInsert: New rows are inserted into the database.</li>
+ * </ul>
+ */
+ public enum UpdateMode {
+ UpdateOnly,
+ AllowInsert
+ }
+
/**
* Thrown when invalid cmdline options are given.
*/
@@ -370,7 +405,7 @@ public class SqoopOptions implements Cloneable {
// If we restore a job and then allow the user to apply arguments on
// top, we retain the version without the arguments in a reference to the
// 'parent' SqoopOptions instance, here.
- private com.cloudera.sqoop.SqoopOptions parent;
+ private SqoopOptions parent;
// Nonce directory name. Generate one per process, lazily, if
// getNonceJarDir() is called. Not recorded in metadata. This is used as
@@ -2312,14 +2347,14 @@ public class SqoopOptions implements Cloneable {
/**
* Return the parent instance this SqoopOptions is derived from.
*/
- public com.cloudera.sqoop.SqoopOptions getParent() {
+ public SqoopOptions getParent() {
return this.parent;
}
/**
* Set the parent instance this SqoopOptions is derived from.
*/
- public void setParent(com.cloudera.sqoop.SqoopOptions options) {
+ public void setParent(SqoopOptions options) {
this.parent = options;
}
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/org/apache/sqoop/accumulo/AccumuloMutationProcessor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/accumulo/AccumuloMutationProcessor.java b/src/java/org/apache/sqoop/accumulo/AccumuloMutationProcessor.java
index 123688c..9167dea 100644
--- a/src/java/org/apache/sqoop/accumulo/AccumuloMutationProcessor.java
+++ b/src/java/org/apache/sqoop/accumulo/AccumuloMutationProcessor.java
@@ -38,9 +38,9 @@ import org.apache.hadoop.conf.Configurable;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.util.ReflectionUtils;
-import com.cloudera.sqoop.lib.FieldMapProcessor;
-import com.cloudera.sqoop.lib.FieldMappable;
-import com.cloudera.sqoop.lib.ProcessingException;
+import org.apache.sqoop.lib.FieldMapProcessor;
+import org.apache.sqoop.lib.FieldMappable;
+import org.apache.sqoop.lib.ProcessingException;
/**
* SqoopRecordProcessor that performs an Accumulo mutation operation
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/org/apache/sqoop/avro/AvroUtil.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/avro/AvroUtil.java b/src/java/org/apache/sqoop/avro/AvroUtil.java
index ee29f14..1aae8df 100644
--- a/src/java/org/apache/sqoop/avro/AvroUtil.java
+++ b/src/java/org/apache/sqoop/avro/AvroUtil.java
@@ -155,7 +155,7 @@ public final class AvroUtil {
private static final String TIME_TYPE = "java.sql.Time";
private static final String DATE_TYPE = "java.sql.Date";
private static final String BIG_DECIMAL_TYPE = "java.math.BigDecimal";
- private static final String BLOB_REF_TYPE = "com.cloudera.sqoop.lib.BlobRef";
+ private static final String BLOB_REF_TYPE = "org.apache.sqoop.lib.BlobRef";
/**
* Convert from Avro type to Sqoop's java representation of the SQL type
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/org/apache/sqoop/cli/ToolOptions.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/cli/ToolOptions.java b/src/java/org/apache/sqoop/cli/ToolOptions.java
index f148897..6ab8901 100644
--- a/src/java/org/apache/sqoop/cli/ToolOptions.java
+++ b/src/java/org/apache/sqoop/cli/ToolOptions.java
@@ -28,8 +28,6 @@ import org.apache.commons.cli.HelpFormatter;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.Options;
-import com.cloudera.sqoop.cli.RelatedOptions;
-
/**
* Class that holds several sets of related options, providing a container
* for all the options associated with a single tool.
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/org/apache/sqoop/config/ConfigurationHelper.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/config/ConfigurationHelper.java b/src/java/org/apache/sqoop/config/ConfigurationHelper.java
index 298907d..e07a699 100644
--- a/src/java/org/apache/sqoop/config/ConfigurationHelper.java
+++ b/src/java/org/apache/sqoop/config/ConfigurationHelper.java
@@ -27,7 +27,7 @@ import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.JobContext;
import org.apache.hadoop.util.GenericOptionsParser;
-import com.cloudera.sqoop.mapreduce.db.DBConfiguration;
+import org.apache.sqoop.mapreduce.db.DBConfiguration;
import org.apache.hadoop.util.ReflectionUtils;
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/org/apache/sqoop/hbase/HBasePutProcessor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/hbase/HBasePutProcessor.java b/src/java/org/apache/sqoop/hbase/HBasePutProcessor.java
index cf97b8a..27d6006 100644
--- a/src/java/org/apache/sqoop/hbase/HBasePutProcessor.java
+++ b/src/java/org/apache/sqoop/hbase/HBasePutProcessor.java
@@ -18,9 +18,9 @@
package org.apache.sqoop.hbase;
-import com.cloudera.sqoop.lib.FieldMapProcessor;
-import com.cloudera.sqoop.lib.FieldMappable;
-import com.cloudera.sqoop.lib.ProcessingException;
+import org.apache.sqoop.lib.FieldMapProcessor;
+import org.apache.sqoop.lib.FieldMappable;
+import org.apache.sqoop.lib.ProcessingException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configurable;
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/org/apache/sqoop/hbase/ToStringPutTransformer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/hbase/ToStringPutTransformer.java b/src/java/org/apache/sqoop/hbase/ToStringPutTransformer.java
index 20bf1b9..0bd6169 100644
--- a/src/java/org/apache/sqoop/hbase/ToStringPutTransformer.java
+++ b/src/java/org/apache/sqoop/hbase/ToStringPutTransformer.java
@@ -18,7 +18,6 @@
package org.apache.sqoop.hbase;
-import com.cloudera.sqoop.hbase.PutTransformer;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/org/apache/sqoop/hive/HiveImport.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/hive/HiveImport.java b/src/java/org/apache/sqoop/hive/HiveImport.java
index 153d091..c272911 100644
--- a/src/java/org/apache/sqoop/hive/HiveImport.java
+++ b/src/java/org/apache/sqoop/hive/HiveImport.java
@@ -45,9 +45,9 @@ import org.apache.sqoop.util.Executor;
import org.apache.sqoop.util.LoggingAsyncSink;
import org.apache.sqoop.util.SubprocessSecurityManager;
-import com.cloudera.sqoop.SqoopOptions;
-import com.cloudera.sqoop.manager.ConnManager;
-import com.cloudera.sqoop.util.ExitSecurityException;
+import org.apache.sqoop.SqoopOptions;
+import org.apache.sqoop.manager.ConnManager;
+import org.apache.sqoop.util.ExitSecurityException;
/**
* Utility to import a table into the Hive metastore. Manages the connection
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/org/apache/sqoop/hive/TableDefWriter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/hive/TableDefWriter.java b/src/java/org/apache/sqoop/hive/TableDefWriter.java
index deec32d..e1424c3 100644
--- a/src/java/org/apache/sqoop/hive/TableDefWriter.java
+++ b/src/java/org/apache/sqoop/hive/TableDefWriter.java
@@ -35,8 +35,8 @@ import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.sqoop.io.CodecMap;
-import com.cloudera.sqoop.SqoopOptions;
-import com.cloudera.sqoop.manager.ConnManager;
+import org.apache.sqoop.SqoopOptions;
+import org.apache.sqoop.manager.ConnManager;
import org.apache.sqoop.util.FileSystemUtil;
/**
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/org/apache/sqoop/io/CodecMap.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/io/CodecMap.java b/src/java/org/apache/sqoop/io/CodecMap.java
index cec9358..d579618 100644
--- a/src/java/org/apache/sqoop/io/CodecMap.java
+++ b/src/java/org/apache/sqoop/io/CodecMap.java
@@ -70,13 +70,13 @@ public final class CodecMap {
/**
* Given a codec name, return the name of the concrete class
* that implements it (or 'null' in the case of the "none" codec).
- * @throws com.cloudera.sqoop.io.UnsupportedCodecException if a codec cannot
+ * @throws org.apache.sqoop.io.UnsupportedCodecException if a codec cannot
* be found with the supplied name.
*/
public static String getCodecClassName(String codecName)
- throws com.cloudera.sqoop.io.UnsupportedCodecException {
+ throws org.apache.sqoop.io.UnsupportedCodecException {
if (!codecNames.containsKey(codecName)) {
- throw new com.cloudera.sqoop.io.UnsupportedCodecException(codecName);
+ throw new org.apache.sqoop.io.UnsupportedCodecException(codecName);
}
return codecNames.get(codecName);
@@ -85,11 +85,11 @@ public final class CodecMap {
/**
* Given a codec name, instantiate the concrete implementation
* class that implements it.
- * @throws com.cloudera.sqoop.io.UnsupportedCodecException if a codec cannot
+ * @throws org.apache.sqoop.io.UnsupportedCodecException if a codec cannot
* be found with the supplied name.
*/
public static CompressionCodec getCodec(String codecName,
- Configuration conf) throws com.cloudera.sqoop.io.UnsupportedCodecException {
+ Configuration conf) throws org.apache.sqoop.io.UnsupportedCodecException {
// Try standard Hadoop mechanism first
CompressionCodec codec = getCodecByName(codecName, conf);
if (codec != null) {
@@ -108,7 +108,7 @@ public final class CodecMap {
return (CompressionCodec) ReflectionUtils.newInstance(
codecClass, conf);
} catch (ClassNotFoundException cnfe) {
- throw new com.cloudera.sqoop.io.UnsupportedCodecException(
+ throw new org.apache.sqoop.io.UnsupportedCodecException(
"Cannot find codec class "
+ codecClassName + " for codec " + codecName);
}
@@ -162,11 +162,11 @@ public final class CodecMap {
*
* @return the short name of the codec
*
- * @throws com.cloudera.sqoop.io.UnsupportedCodecException
+ * @throws org.apache.sqoop.io.UnsupportedCodecException
* if no short name could be found
*/
public static String getCodecShortNameByName(String codecName,
- Configuration conf) throws com.cloudera.sqoop.io.UnsupportedCodecException {
+ Configuration conf) throws org.apache.sqoop.io.UnsupportedCodecException {
if (codecNames.containsKey(codecName)) {
return codecName;
}
@@ -186,7 +186,7 @@ public final class CodecMap {
return simpleName.toLowerCase();
}
- throw new com.cloudera.sqoop.io.UnsupportedCodecException(
+ throw new org.apache.sqoop.io.UnsupportedCodecException(
"Cannot find codec class " + codecName + " for codec " + codecName);
}
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/org/apache/sqoop/io/LobFile.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/io/LobFile.java b/src/java/org/apache/sqoop/io/LobFile.java
index 4edde12..ec0f8fa 100644
--- a/src/java/org/apache/sqoop/io/LobFile.java
+++ b/src/java/org/apache/sqoop/io/LobFile.java
@@ -62,8 +62,7 @@ import org.apache.hadoop.io.compress.CompressorStream;
import org.apache.hadoop.io.compress.Decompressor;
import org.apache.hadoop.io.compress.DecompressorStream;
-import com.cloudera.sqoop.io.LobReaderCache;
-import com.cloudera.sqoop.util.RandomHash;
+import org.apache.sqoop.util.RandomHash;
/**
* File format which stores large object records.
@@ -97,7 +96,7 @@ public final class LobFile {
/**
* Creates a LobFile Reader configured to read from the specified file.
*/
- public static com.cloudera.sqoop.io.LobFile.Reader
+ public static org.apache.sqoop.io.LobFile.Reader
open(Path p, Configuration conf) throws IOException {
FileSystem fs = p.getFileSystem(conf);
FileStatus [] stats = fs.listStatus(p);
@@ -125,7 +124,7 @@ public final class LobFile {
* @param codec the compression codec to use (or null for none).
* @param entriesPerSegment number of entries per index segment.
*/
- public static com.cloudera.sqoop.io.LobFile.Writer
+ public static org.apache.sqoop.io.LobFile.Writer
create(Path p, Configuration conf, boolean isCharData,
String codec, int entriesPerSegment)
throws IOException {
@@ -139,7 +138,7 @@ public final class LobFile {
* @param isCharData true if this is for CLOBs, false for BLOBs.
* @param codec the compression codec to use (or null for none).
*/
- public static com.cloudera.sqoop.io.LobFile.Writer
+ public static org.apache.sqoop.io.LobFile.Writer
create(Path p, Configuration conf, boolean isCharData,
String codec) throws IOException {
return create(p, conf, isCharData, codec,
@@ -152,7 +151,7 @@ public final class LobFile {
* @param conf the configuration to use to interact with the filesystem.
* @param isCharData true if this is for CLOBs, false for BLOBs.
*/
- public static com.cloudera.sqoop.io.LobFile.Writer
+ public static org.apache.sqoop.io.LobFile.Writer
create(Path p, Configuration conf, boolean isCharData)
throws IOException {
return create(p, conf, isCharData, null);
@@ -163,7 +162,7 @@ public final class LobFile {
* @param p the path to create.
* @param conf the configuration to use to interact with the filesystem.
*/
- public static com.cloudera.sqoop.io.LobFile.Writer
+ public static org.apache.sqoop.io.LobFile.Writer
create(Path p, Configuration conf) throws IOException {
return create(p, conf, false);
}
@@ -962,7 +961,7 @@ public final class LobFile {
* Reader implementation for LobFile format version 0. Acquire with
* LobFile.open().
*/
- private static class V0Reader extends com.cloudera.sqoop.io.LobFile.Reader {
+ private static class V0Reader extends org.apache.sqoop.io.LobFile.Reader {
public static final Log LOG = LogFactory.getLog(
V0Reader.class.getName());
@@ -1523,7 +1522,7 @@ public final class LobFile {
* Concrete writer implementation for LobFile format version 0.
* Instantiate via LobFile.create().
*/
- private static class V0Writer extends com.cloudera.sqoop.io.LobFile.Writer {
+ private static class V0Writer extends org.apache.sqoop.io.LobFile.Writer {
public static final Log LOG = LogFactory.getLog(
V0Writer.class.getName());
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/org/apache/sqoop/io/LobReaderCache.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/io/LobReaderCache.java b/src/java/org/apache/sqoop/io/LobReaderCache.java
index dbfa4f1..5c61906 100644
--- a/src/java/org/apache/sqoop/io/LobReaderCache.java
+++ b/src/java/org/apache/sqoop/io/LobReaderCache.java
@@ -26,7 +26,7 @@ import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
-import com.cloudera.sqoop.io.LobFile;
+import org.apache.sqoop.io.LobFile;
import org.apache.sqoop.util.FileSystemUtil;
/**
@@ -44,6 +44,30 @@ public class LobReaderCache {
private Map<Path, LobFile.Reader> readerMap;
+ private static final LobReaderCache CACHE;
+ static {
+ CACHE = new LobReaderCache();
+ }
+
+ /**
+ * @return the singleton LobReaderCache instance.
+ */
+ public static LobReaderCache getCache() {
+ return CACHE;
+ }
+
+ /**
+ * Created a fully-qualified path object.
+ * @param path the path to fully-qualify with its fs URI.
+ * @param conf the current Hadoop FS configuration.
+ * @return a new path representing the same location as the input 'path',
+ * but with a fully-qualified URI.
+ */
+ public static Path qualify(Path path, Configuration conf)
+ throws IOException {
+ return org.apache.sqoop.util.FileSystemUtil.makeQualified(path, conf);
+ }
+
/**
* Open a LobFile for read access, returning a cached reader if one is
* available, or a new reader otherwise.
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/org/apache/sqoop/lib/BlobRef.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/lib/BlobRef.java b/src/java/org/apache/sqoop/lib/BlobRef.java
index bff6b71..97a8276 100644
--- a/src/java/org/apache/sqoop/lib/BlobRef.java
+++ b/src/java/org/apache/sqoop/lib/BlobRef.java
@@ -29,14 +29,14 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.io.BytesWritable;
-import com.cloudera.sqoop.io.LobFile;
+import org.apache.sqoop.io.LobFile;
/**
* BlobRef is a wrapper that holds a BLOB either directly, or a
* reference to a file that holds the BLOB data.
*/
public class BlobRef extends
- com.cloudera.sqoop.lib.LobRef<byte[], BytesWritable, InputStream> {
+ LobRef<byte[], BytesWritable, InputStream> {
public static final Log LOG = LogFactory.getLog(BlobRef.class.getName());
@@ -107,7 +107,7 @@ public class BlobRef extends
* @return a new BlobRef containing a reference to an external BLOB, or
* an empty BlobRef if the data to be parsed is actually inline.
*/
- public static com.cloudera.sqoop.lib.BlobRef parse(String inputString) {
+ public static org.apache.sqoop.lib.BlobRef parse(String inputString) {
// If inputString is of the form 'externalLob(lf,%s,%d,%d)', then this is
// an external BLOB stored at the LobFile indicated by '%s' with the next
// two arguments representing its offset and length in the file.
@@ -118,13 +118,13 @@ public class BlobRef extends
if (m.matches()) {
// This is a LobFile. Extract the filename, offset and len from the
// matcher.
- return new com.cloudera.sqoop.lib.BlobRef(m.group(1),
+ return new org.apache.sqoop.lib.BlobRef(m.group(1),
Long.valueOf(m.group(2)), Long.valueOf(m.group(3)));
} else {
// This is inline BLOB string data.
LOG.warn(
"Reparsing inline BLOB data is not supported; use SequenceFiles.");
- return new com.cloudera.sqoop.lib.BlobRef();
+ return new org.apache.sqoop.lib.BlobRef();
}
}
}
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/org/apache/sqoop/lib/ClobRef.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/lib/ClobRef.java b/src/java/org/apache/sqoop/lib/ClobRef.java
index efe468a..3fd822d 100644
--- a/src/java/org/apache/sqoop/lib/ClobRef.java
+++ b/src/java/org/apache/sqoop/lib/ClobRef.java
@@ -26,14 +26,14 @@ import java.util.regex.Matcher;
import org.apache.hadoop.io.Text;
-import com.cloudera.sqoop.io.LobFile;
+import org.apache.sqoop.io.LobFile;
/**
* ClobRef is a wrapper that holds a CLOB either directly, or a
* reference to a file that holds the CLOB data.
*/
public class ClobRef
- extends com.cloudera.sqoop.lib.LobRef<String, String, Reader> {
+ extends LobRef<String, String, Reader> {
public ClobRef() {
super();
@@ -90,7 +90,7 @@ public class ClobRef
* @param inputString the text-based input data to parse.
* @return a ClobRef to the given data.
*/
- public static com.cloudera.sqoop.lib.ClobRef parse(String inputString) {
+ public static org.apache.sqoop.lib.ClobRef parse(String inputString) {
// If inputString is of the form 'externalLob(lf,%s,%d,%d)', then this is
// an external CLOB stored at the LobFile indicated by '%s' with the next
// two arguments representing its offset and length in the file.
@@ -101,11 +101,11 @@ public class ClobRef
if (m.matches()) {
// This is a LobFile. Extract the filename, offset and len from the
// matcher.
- return new com.cloudera.sqoop.lib.ClobRef(m.group(1),
+ return new org.apache.sqoop.lib.ClobRef(m.group(1),
Long.valueOf(m.group(2)), Long.valueOf(m.group(3)));
} else {
// This is inline CLOB string data.
- return new com.cloudera.sqoop.lib.ClobRef(inputString);
+ return new org.apache.sqoop.lib.ClobRef(inputString);
}
}
}
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/org/apache/sqoop/lib/DelimiterSet.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/lib/DelimiterSet.java b/src/java/org/apache/sqoop/lib/DelimiterSet.java
index d76890e..36c8e53 100644
--- a/src/java/org/apache/sqoop/lib/DelimiterSet.java
+++ b/src/java/org/apache/sqoop/lib/DelimiterSet.java
@@ -60,6 +60,21 @@ public class DelimiterSet implements Cloneable {
"sqoop.input.escaped.by";
public static final String INPUT_ENCLOSE_REQUIRED_KEY =
"sqoop.input.enclose.required";
+
+ // Static delimiter sets for the commonly-used delimiter arrangements.
+
+ public static final DelimiterSet DEFAULT_DELIMITERS;
+ public static final DelimiterSet HIVE_DELIMITERS;
+ public static final DelimiterSet MYSQL_DELIMITERS;
+
+ static {
+ DEFAULT_DELIMITERS = new DelimiterSet(',', '\n', NULL_CHAR, NULL_CHAR,
+ false);
+ MYSQL_DELIMITERS = new DelimiterSet(',', '\n', '\'', '\\', false);
+ HIVE_DELIMITERS = new DelimiterSet('\001', '\n',
+ NULL_CHAR, NULL_CHAR, false);
+ }
+
/**
* Create a delimiter set with the default delimiters
* (comma for fields, newline for records).
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/org/apache/sqoop/lib/FieldFormatter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/lib/FieldFormatter.java b/src/java/org/apache/sqoop/lib/FieldFormatter.java
index a6b055b..ba8d18e 100644
--- a/src/java/org/apache/sqoop/lib/FieldFormatter.java
+++ b/src/java/org/apache/sqoop/lib/FieldFormatter.java
@@ -36,8 +36,7 @@ public final class FieldFormatter {
* @param delimiters
* @return
*/
- public static String hiveStringDropDelims(String str,
- com.cloudera.sqoop.lib.DelimiterSet delimiters) {
+ public static String hiveStringDropDelims(String str, DelimiterSet delimiters) {
return hiveStringReplaceDelims(str, "", delimiters);
}
@@ -48,8 +47,7 @@ public final class FieldFormatter {
* @param delimiters
* @return
*/
- public static String hiveStringReplaceDelims(String str, String replacement,
- com.cloudera.sqoop.lib.DelimiterSet delimiters) {
+ public static String hiveStringReplaceDelims(String str, String replacement, DelimiterSet delimiters) {
String droppedDelims = REPLACE_PATTERN.matcher(str).replaceAll(replacement);
return escapeAndEnclose(droppedDelims, delimiters);
}
@@ -75,16 +73,14 @@ public final class FieldFormatter {
* '\000', those operations are not performed.
* @return the escaped, enclosed version of 'str'.
*/
- public static String escapeAndEnclose(String str,
- com.cloudera.sqoop.lib.DelimiterSet delimiters) {
+ public static String escapeAndEnclose(String str, DelimiterSet delimiters) {
char escape = delimiters.getEscapedBy();
char enclose = delimiters.getEnclosedBy();
boolean encloseRequired = delimiters.isEncloseRequired();
// true if we can use an escape character.
- boolean escapingLegal =
- com.cloudera.sqoop.lib.DelimiterSet.NULL_CHAR != escape;
+ boolean escapingLegal = DelimiterSet.NULL_CHAR != escape;
String withEscapes;
if (null == str) {
@@ -99,7 +95,7 @@ public final class FieldFormatter {
withEscapes = str;
}
- if (com.cloudera.sqoop.lib.DelimiterSet.NULL_CHAR == enclose) {
+ if (DelimiterSet.NULL_CHAR == enclose) {
// The enclose-with character was left unset, so we can't enclose items.
if (escapingLegal) {
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/org/apache/sqoop/lib/FieldMapProcessor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/lib/FieldMapProcessor.java b/src/java/org/apache/sqoop/lib/FieldMapProcessor.java
index 6a4ade9..4885571 100644
--- a/src/java/org/apache/sqoop/lib/FieldMapProcessor.java
+++ b/src/java/org/apache/sqoop/lib/FieldMapProcessor.java
@@ -19,9 +19,6 @@ package org.apache.sqoop.lib;
import java.io.IOException;
-import com.cloudera.sqoop.lib.FieldMappable;
-import com.cloudera.sqoop.lib.ProcessingException;
-
/**
* Interface implemented by classes that process FieldMappable objects.
*/
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/org/apache/sqoop/lib/JdbcWritableBridge.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/lib/JdbcWritableBridge.java b/src/java/org/apache/sqoop/lib/JdbcWritableBridge.java
index afde585..d9628dc 100644
--- a/src/java/org/apache/sqoop/lib/JdbcWritableBridge.java
+++ b/src/java/org/apache/sqoop/lib/JdbcWritableBridge.java
@@ -27,9 +27,6 @@ import java.sql.Timestamp;
import org.apache.hadoop.io.BytesWritable;
-import com.cloudera.sqoop.lib.BlobRef;
-import com.cloudera.sqoop.lib.ClobRef;
-
/**
* Contains a set of methods which can read db columns from a ResultSet into
* Java types, and do serialization of these types to/from DataInput/DataOutput
@@ -242,13 +239,13 @@ public final class JdbcWritableBridge {
}
}
- public static void writeBlobRef(com.cloudera.sqoop.lib.BlobRef val,
+ public static void writeBlobRef(org.apache.sqoop.lib.BlobRef val,
int paramIdx, int sqlType, PreparedStatement s) throws SQLException {
// TODO: support this.
throw new RuntimeException("Unsupported: Cannot export BLOB data");
}
- public static void writeClobRef(com.cloudera.sqoop.lib.ClobRef val,
+ public static void writeClobRef(org.apache.sqoop.lib.ClobRef val,
int paramIdx, int sqlType, PreparedStatement s) throws SQLException {
// TODO: support this.
throw new RuntimeException("Unsupported: Cannot export CLOB data");
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/org/apache/sqoop/lib/LargeObjectLoader.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/lib/LargeObjectLoader.java b/src/java/org/apache/sqoop/lib/LargeObjectLoader.java
index b8525fe..8cfee02 100644
--- a/src/java/org/apache/sqoop/lib/LargeObjectLoader.java
+++ b/src/java/org/apache/sqoop/lib/LargeObjectLoader.java
@@ -36,8 +36,8 @@ import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
-import com.cloudera.sqoop.io.LobFile;
-import com.cloudera.sqoop.util.TaskId;
+import org.apache.sqoop.io.LobFile;
+import org.apache.sqoop.util.TaskId;
/**
* Contains a set of methods which can read db columns from a ResultSet into
@@ -228,7 +228,7 @@ public class LargeObjectLoader implements Closeable {
* @throws IOException if an error occurs writing to the FileSystem.
* @throws SQLException if an error occurs reading from the database.
*/
- public com.cloudera.sqoop.lib.BlobRef readBlobRef(int colNum, ResultSet r)
+ public org.apache.sqoop.lib.BlobRef readBlobRef(int colNum, ResultSet r)
throws IOException, InterruptedException, SQLException {
long maxInlineLobLen = conf.getLong(
@@ -262,11 +262,11 @@ public class LargeObjectLoader implements Closeable {
lobWriter.finishRecord();
}
- return new com.cloudera.sqoop.lib.BlobRef(
+ return new org.apache.sqoop.lib.BlobRef(
getRelativePath(curBlobWriter), recordOffset, len);
} else {
// This is a 1-based array.
- return new com.cloudera.sqoop.lib.BlobRef(
+ return new org.apache.sqoop.lib.BlobRef(
b.getBytes(1, (int) b.length()));
}
}
@@ -282,7 +282,7 @@ public class LargeObjectLoader implements Closeable {
* @throws IOException if an error occurs writing to the FileSystem.
* @throws SQLException if an error occurs reading from the database.
*/
- public com.cloudera.sqoop.lib.ClobRef readClobRef(int colNum, ResultSet r)
+ public org.apache.sqoop.lib.ClobRef readClobRef(int colNum, ResultSet r)
throws IOException, InterruptedException, SQLException {
long maxInlineLobLen = conf.getLong(
@@ -316,11 +316,11 @@ public class LargeObjectLoader implements Closeable {
lobWriter.finishRecord();
}
- return new com.cloudera.sqoop.lib.ClobRef(
+ return new org.apache.sqoop.lib.ClobRef(
getRelativePath(lobWriter), recordOffset, len);
} else {
// This is a 1-based array.
- return new com.cloudera.sqoop.lib.ClobRef(
+ return new org.apache.sqoop.lib.ClobRef(
c.getSubString(1, (int) c.length()));
}
}
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/org/apache/sqoop/lib/LobRef.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/lib/LobRef.java b/src/java/org/apache/sqoop/lib/LobRef.java
index d6d6b25..4abddc4 100644
--- a/src/java/org/apache/sqoop/lib/LobRef.java
+++ b/src/java/org/apache/sqoop/lib/LobRef.java
@@ -34,8 +34,8 @@ import org.apache.hadoop.mapreduce.InputSplit;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.lib.input.FileSplit;
-import com.cloudera.sqoop.io.LobFile;
-import com.cloudera.sqoop.io.LobReaderCache;
+import org.apache.sqoop.io.LobFile;
+import org.apache.sqoop.io.LobReaderCache;
/**
* Abstract base class that holds a reference to a Blob or a Clob.
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/org/apache/sqoop/lib/LobSerializer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/lib/LobSerializer.java b/src/java/org/apache/sqoop/lib/LobSerializer.java
index a30ffe7..4702356 100644
--- a/src/java/org/apache/sqoop/lib/LobSerializer.java
+++ b/src/java/org/apache/sqoop/lib/LobSerializer.java
@@ -29,25 +29,25 @@ public final class LobSerializer {
private LobSerializer() { }
public static void writeClob(
- com.cloudera.sqoop.lib.ClobRef clob, DataOutput out) throws IOException {
+ org.apache.sqoop.lib.ClobRef clob, DataOutput out) throws IOException {
clob.write(out);
}
public static void writeBlob(
- com.cloudera.sqoop.lib.BlobRef blob, DataOutput out) throws IOException {
+ org.apache.sqoop.lib.BlobRef blob, DataOutput out) throws IOException {
blob.write(out);
}
- public static com.cloudera.sqoop.lib.ClobRef readClobFields(
+ public static org.apache.sqoop.lib.ClobRef readClobFields(
DataInput in) throws IOException {
- com.cloudera.sqoop.lib.ClobRef clob = new com.cloudera.sqoop.lib.ClobRef();
+ org.apache.sqoop.lib.ClobRef clob = new org.apache.sqoop.lib.ClobRef();
clob.readFields(in);
return clob;
}
- public static com.cloudera.sqoop.lib.BlobRef readBlobFields(
+ public static org.apache.sqoop.lib.BlobRef readBlobFields(
DataInput in) throws IOException {
- com.cloudera.sqoop.lib.BlobRef blob = new com.cloudera.sqoop.lib.BlobRef();
+ org.apache.sqoop.lib.BlobRef blob = new org.apache.sqoop.lib.BlobRef();
blob.readFields(in);
return blob;
}
http://git-wip-us.apache.org/repos/asf/sqoop/blob/6984a36c/src/java/org/apache/sqoop/lib/RecordParser.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/lib/RecordParser.java b/src/java/org/apache/sqoop/lib/RecordParser.java
index 7c29151..e641aff 100644
--- a/src/java/org/apache/sqoop/lib/RecordParser.java
+++ b/src/java/org/apache/sqoop/lib/RecordParser.java
@@ -84,11 +84,11 @@ public class RecordParser {
}
}
- private com.cloudera.sqoop.lib.DelimiterSet delimiters;
+ private DelimiterSet delimiters;
private ArrayList<String> outputs;
- public RecordParser(final com.cloudera.sqoop.lib.DelimiterSet delimitersIn) {
+ public RecordParser(final DelimiterSet delimitersIn) {
this.delimiters = delimitersIn.copy();
this.outputs = new ArrayList<String>();
}
@@ -99,9 +99,9 @@ public class RecordParser {
* next call to parseRecord().
*/
public List<String> parseRecord(CharSequence input)
- throws com.cloudera.sqoop.lib.RecordParser.ParseError {
+ throws org.apache.sqoop.lib.RecordParser.ParseError {
if (null == input) {
- throw new com.cloudera.sqoop.lib.RecordParser.ParseError(
+ throw new org.apache.sqoop.lib.RecordParser.ParseError(
"null input string");
}
@@ -114,9 +114,9 @@ public class RecordParser {
* next call to parseRecord().
*/
public List<String> parseRecord(Text input)
- throws com.cloudera.sqoop.lib.RecordParser.ParseError {
+ throws org.apache.sqoop.lib.RecordParser.ParseError {
if (null == input) {
- throw new com.cloudera.sqoop.lib.RecordParser.ParseError(
+ throw new org.apache.sqoop.lib.RecordParser.ParseError(
"null input string");
}
@@ -131,9 +131,9 @@ public class RecordParser {
* next call to parseRecord().
*/
public List<String> parseRecord(byte [] input)
- throws com.cloudera.sqoop.lib.RecordParser.ParseError {
+ throws org.apache.sqoop.lib.RecordParser.ParseError {
if (null == input) {
- throw new com.cloudera.sqoop.lib.RecordParser.ParseError(
+ throw new org.apache.sqoop.lib.RecordParser.ParseError(
"null input string");
}
@@ -146,9 +146,9 @@ public class RecordParser {
* next call to parseRecord().
*/
public List<String> parseRecord(char [] input)
- throws com.cloudera.sqoop.lib.RecordParser.ParseError {
+ throws org.apache.sqoop.lib.RecordParser.ParseError {
if (null == input) {
- throw new com.cloudera.sqoop.lib.RecordParser.ParseError(
+ throw new org.apache.sqoop.lib.RecordParser.ParseError(
"null input string");
}
@@ -156,9 +156,9 @@ public class RecordParser {
}
public List<String> parseRecord(ByteBuffer input)
- throws com.cloudera.sqoop.lib.RecordParser.ParseError {
+ throws org.apache.sqoop.lib.RecordParser.ParseError {
if (null == input) {
- throw new com.cloudera.sqoop.lib.RecordParser.ParseError(
+ throw new org.apache.sqoop.lib.RecordParser.ParseError(
"null input string");
}
@@ -173,9 +173,9 @@ public class RecordParser {
* next call to parseRecord().
*/
public List<String> parseRecord(CharBuffer input)
- throws com.cloudera.sqoop.lib.RecordParser.ParseError {
+ throws org.apache.sqoop.lib.RecordParser.ParseError {
if (null == input) {
- throw new com.cloudera.sqoop.lib.RecordParser.ParseError(
+ throw new org.apache.sqoop.lib.RecordParser.ParseError(
"null input string");
}
@@ -218,7 +218,7 @@ public class RecordParser {
add charater literal to current string, return to UNENCLOSED_FIELD
*/
- char curChar = com.cloudera.sqoop.lib.DelimiterSet.NULL_CHAR;
+ char curChar = DelimiterSet.NULL_CHAR;
ParseState state = ParseState.FIELD_START;
int len = input.length();
StringBuilder sb = null;
@@ -259,7 +259,7 @@ public class RecordParser {
sb.append(curChar);
if (enclosingRequired) {
- throw new com.cloudera.sqoop.lib.RecordParser.ParseError(
+ throw new org.apache.sqoop.lib.RecordParser.ParseError(
"Opening field-encloser expected at position " + pos);
}
}
@@ -316,7 +316,7 @@ public class RecordParser {
pos = len;
} else {
// Don't know what to do with this character.
- throw new com.cloudera.sqoop.lib.RecordParser.ParseError(
+ throw new org.apache.sqoop.lib.RecordParser.ParseError(
"Expected delimiter at position " + pos);
}
@@ -330,7 +330,7 @@ public class RecordParser {
break;
default:
- throw new com.cloudera.sqoop.lib.RecordParser.ParseError(
+ throw new org.apache.sqoop.lib.RecordParser.ParseError(
"Unexpected parser state: " + state);
}
}