// Path: com.ibm.streamsx.hdfs/impl/java/src/com/ibm/streamsx/hdfs/client/HdfsJavaClient.java
// public class HdfsJavaClient extends AbstractHdfsClient {
// 
// 	private Logger logger = Logger.getLogger("HdfsJavaClient");
// 
// 	public HdfsJavaClient() {
// 	}
// }
// 
// Path: com.ibm.streamsx.hdfs/impl/java/src/com/ibm/streamsx/hdfs/client/IHdfsClient.java
// public interface IHdfsClient {
// 
// 	public FileSystem connect(String fileSystemUri, String hdfsUser, String configPath) throws Exception;
// 
// 	public InputStream getInputStream(String filePath) throws IOException;
// 
// 	public OutputStream getOutputStream(String filePath, boolean append) throws IOException;
// 
// 	public FileStatus[] scanDirectory(String dirPath, String filter) throws IOException;
// 
// 	public boolean exists(String filePath) throws IOException;
// 
// 	public boolean isDirectory(String filePath) throws IOException;
// 
// 	public long getFileSize(String filename) throws IOException;
// 
// 	public boolean rename(String src, String dst) throws IOException;
// 
// 	public boolean delete(String filePath, boolean recursive) throws IOException;
// 
// 	public void disconnect() throws Exception;
// 
// 	public void setConnectionProperty(String name, String value);
// 
// 	public String getConnectionProperty(String name);
// 
// 	public Map<String, String> getConnectionProperties();
// }


import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Logger;
import java.util.concurrent.TimeUnit;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import com.ibm.json.java.JSONObject;
import com.ibm.streams.operator.AbstractOperator;
import com.ibm.streams.operator.OperatorContext;
import com.ibm.streams.operator.OperatorContext.ContextCheck;
import com.ibm.streams.operator.compile.OperatorContextChecker;
import com.ibm.streams.operator.logging.LogLevel;
import com.ibm.streams.operator.logging.LoggerNames;
import com.ibm.streams.operator.logging.TraceLevel;
import com.ibm.streams.operator.model.Parameter;
import com.ibm.streams.operator.state.StateHandler;
import com.ibm.streamsx.hdfs.client.HdfsJavaClient;
import com.ibm.streamsx.hdfs.client.IHdfsClient;
/*******************************************************************************
 * Copyright (C) 2017-2019, International Business Machines Corporation
 * All Rights Reserved
 *******************************************************************************/

package com.ibm.streamsx.hdfs;





public abstract class AbstractHdfsOperator extends AbstractOperator implements StateHandler {

	private static final String CLASS_NAME = "com.ibm.streamsx.hdfs.AbstractHdfsOperator";

	/** Create a logger specific to this class */
	private static Logger LOGGER = Logger.getLogger(LoggerNames.LOG_FACILITY + "." + CLASS_NAME);

	private static Logger TRACE = Logger.getLogger(CLASS_NAME);

	// Common parameters and variables for connection
// Path: com.ibm.streamsx.hdfs/impl/java/src/com/ibm/streamsx/hdfs/client/HdfsJavaClient.java
// public class HdfsJavaClient extends AbstractHdfsClient {
// 
// 	private Logger logger = Logger.getLogger("HdfsJavaClient");
// 
// 	public HdfsJavaClient() {
// 	}
// }
// 
// Path: com.ibm.streamsx.hdfs/impl/java/src/com/ibm/streamsx/hdfs/client/IHdfsClient.java
// public interface IHdfsClient {
// 
// 	public FileSystem connect(String fileSystemUri, String hdfsUser, String configPath) throws Exception;
// 
// 	public InputStream getInputStream(String filePath) throws IOException;
// 
// 	public OutputStream getOutputStream(String filePath, boolean append) throws IOException;
// 
// 	public FileStatus[] scanDirectory(String dirPath, String filter) throws IOException;
// 
// 	public boolean exists(String filePath) throws IOException;
// 
// 	public boolean isDirectory(String filePath) throws IOException;
// 
// 	public long getFileSize(String filename) throws IOException;
// 
// 	public boolean rename(String src, String dst) throws IOException;
// 
// 	public boolean delete(String filePath, boolean recursive) throws IOException;
// 
// 	public void disconnect() throws Exception;
// 
// 	public void setConnectionProperty(String name, String value);
// 
// 	public String getConnectionProperty(String name);
// 
// 	public Map<String, String> getConnectionProperties();
// }


// Path: com.ibm.streamsx.hdfs/impl/java/src/com/ibm/streamsx/hdfs/AbstractHdfsOperator.java
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Logger;
import java.util.concurrent.TimeUnit;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import com.ibm.json.java.JSONObject;
import com.ibm.streams.operator.AbstractOperator;
import com.ibm.streams.operator.OperatorContext;
import com.ibm.streams.operator.OperatorContext.ContextCheck;
import com.ibm.streams.operator.compile.OperatorContextChecker;
import com.ibm.streams.operator.logging.LogLevel;
import com.ibm.streams.operator.logging.LoggerNames;
import com.ibm.streams.operator.logging.TraceLevel;
import com.ibm.streams.operator.model.Parameter;
import com.ibm.streams.operator.state.StateHandler;
import com.ibm.streamsx.hdfs.client.HdfsJavaClient;
import com.ibm.streamsx.hdfs.client.IHdfsClient;

/*******************************************************************************
 * Copyright (C) 2017-2019, International Business Machines Corporation
 * All Rights Reserved
 *******************************************************************************/

package com.ibm.streamsx.hdfs;





public abstract class AbstractHdfsOperator extends AbstractOperator implements StateHandler {

	private static final String CLASS_NAME = "com.ibm.streamsx.hdfs.AbstractHdfsOperator";

	/** Create a logger specific to this class */
	private static Logger LOGGER = Logger.getLogger(LoggerNames.LOG_FACILITY + "." + CLASS_NAME);

	private static Logger TRACE = Logger.getLogger(CLASS_NAME);

	// Common parameters and variables for connection
	private IHdfsClient fHdfsClient;