common/src/main/java/gr/ntua/ece/cslab/selis/bda/common/storage/connectors/ConnectorFactory.java
public Connector generateConnector(String fs, String username, String password, Configuration configuration)
        throws SystemConnectorException {

        Connector connector;

        int connectorType = ConnectorFactory.getConnectorType(fs);

        try{
            if (connectorType == ConnectorFactory.CONNECTOR_HDFS_TYPE) {
                connector = new HDFSConnector(fs, username, password, configuration);
            } else if (connectorType == ConnectorFactory.CONNECTOR_HBASE_TYPE) {
                connector = new HBaseConnector(fs, username, password, configuration);
            } else if (connectorType == ConnectorFactory.CONNECTOR_POSTGRES_TYPE) {
                connector = new PostgresqlConnector(fs, username, password);
            } else {
                connector = new LocalFSConnector(fs, username, password);
            }
        } catch (Exception e){
            e.printStackTrace();
            throw new SystemConnectorException("Could not create new connector.");
        }

        return connector;
    }
/** Depending on the FS string format initialize a connector from a different class.
     *  Connectors are implemented for four different filesystems: local, HBase, HDFS, PostgreSQL. **/
Depending on the FS string format initialize a connector from a different class.
Connectors are implemented for four different filesystems: local, HBase, HDFS, PostgreSQL.
Depending on the FS string format initialize a connector from a different class . Connectors are implemented for four different filesystems : local HBase HDFS PostgreSQL .
public Connector generateConnector(String fs, String username, String password, Configuration configuration)
        throws SystemConnectorException {
        Connector connector;
        int connectorType = ConnectorFactory.getConnectorType(fs);
        try{
            if (connectorType == ConnectorFactory.CONNECTOR_HDFS_TYPE) {
                connector = new HDFSConnector(fs, username, password, configuration);
            } else if (connectorType == ConnectorFactory.CONNECTOR_HBASE_TYPE) {
                connector = new HBaseConnector(fs, username, password, configuration);
            } else if (connectorType == ConnectorFactory.CONNECTOR_POSTGRES_TYPE) {
                connector = new PostgresqlConnector(fs, username, password);
            } else {
                connector = new LocalFSConnector(fs, username, password);
            }
        } catch (Exception e){
            e.printStackTrace();
            throw new SystemConnectorException("Could not create new connector.");
        }
        return connector;
    }
public Connector generateConnector ( String fs , String username , String password , Configuration configuration ) throws SystemConnectorException { Connector connector ; int connectorType = ConnectorFactory . getConnectorType ( fs ) ; try { if ( connectorType == ConnectorFactory . CONNECTOR_HDFS_TYPE ) { connector = new HDFSConnector ( fs , username , password , configuration ) ; } else if ( connectorType == ConnectorFactory . CONNECTOR_HBASE_TYPE ) { connector = new HBaseConnector ( fs , username , password , configuration ) ; } else if ( connectorType == ConnectorFactory . CONNECTOR_POSTGRES_TYPE ) { connector = new PostgresqlConnector ( fs , username , password ) ; } else { connector = new LocalFSConnector ( fs , username , password ) ; } } catch ( Exception e ) { e . printStackTrace ( ) ; throw new SystemConnectorException ( "Could not create new connector." ) ; } return connector ; }
Depending on the FS string format initialize a connector from a different class.
Depending on the FS string format initialize a connector from a different class .