本文整理汇总了Java中com.infobright.io.InfobrightNamedPipeLoader.start方法的典型用法代码示例。如果您正苦于以下问题:Java InfobrightNamedPipeLoader.start方法的具体用法?Java InfobrightNamedPipeLoader.start怎么用?Java InfobrightNamedPipeLoader.start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.infobright.io.InfobrightNamedPipeLoader
的用法示例。
在下文中一共展示了InfobrightNamedPipeLoader.start方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: databaseSetup
import com.infobright.io.InfobrightNamedPipeLoader; //导入方法依赖的package包/类
void databaseSetup(InfobrightLoaderMeta meta, InfobrightLoader step) throws KettleException {
db = new Database(meta.getDatabaseMeta());
db.connect();
// FIXME: This will fail if the first row of the table contains a value that
// cannot be read by Java. For example, a DATE field that contains the value
// '0000-00-00'. In this case, the Kettle error message will misleadingly say
// that the table doesn't exist. There doesn't seem to be any workaround.
// See Pentaho JIRA: PDI-2117.
//
requiredRowMeta = meta.getRequiredFields(step);
requiredFields = requiredRowMeta.getFieldNames();
try {
// once the loader is built, this db connection cannot be used by this thread anymore.
// the loader is using it and any other uses of the connection will block.
if (meta.getInfobrightProductType() == null) {
meta.setDataFormat(DataFormat.TXT_VARIABLE); // default for ICE
}
DataFormat dataFormat = DataFormat.valueForDisplayName(meta.getInfobrightProductType());
Connection conn = db.getConnection();
String tableName = meta.getDatabaseMeta().getQuotedSchemaTableCombination(step.environmentSubstitute(meta.getSchemaName()), step.environmentSubstitute(meta.getTablename()));
EtlLogger logger = new KettleEtlLogger(step);
loader = new InfobrightNamedPipeLoader(tableName, conn, logger, dataFormat);
record = loader.createRecord(false); // TODO set to true to support error path
loader.start();
} catch (Exception e) {
db.disconnect();
db = null;
if (loader != null) {
try {
loader.killQuery();
} catch (SQLException e1) {
throw new KettleDatabaseException(e1);
}
}
throw new KettleDatabaseException(e);
}
}
示例2: databaseSetup
import com.infobright.io.InfobrightNamedPipeLoader; //导入方法依赖的package包/类
void databaseSetup(InfobrightLoaderMeta meta, InfobrightLoader step) throws KettleException {
db = new Database(step, meta.getDatabaseMeta());
db.connect();
// FIXME: This will fail if the first row of the table contains a value that
// cannot be read by Java. For example, a DATE field that contains the value
// '0000-00-00'. In this case, the Kettle error message will misleadingly say
// that the table doesn't exist. There doesn't seem to be any workaround.
// See Pentaho JIRA: PDI-2117.
//
requiredRowMeta = meta.getRequiredFields(step);
requiredFields = requiredRowMeta.getFieldNames();
try {
// once the loader is built, this db connection cannot be used by this thread anymore.
// the loader is using it and any other uses of the connection will block.
if (meta.getInfobrightProductType() == null) {
meta.setDataFormat(DataFormat.TXT_VARIABLE); // default for ICE
}
DataFormat dataFormat = DataFormat.valueForDisplayName(meta.getInfobrightProductType());
int agentPort = meta.getAgentPort();
Charset charset = meta.getCharset();
Connection conn = db.getConnection();
String tableName = meta.getDatabaseMeta().getQuotedSchemaTableCombination(step.environmentSubstitute(meta.getSchemaName()), step.environmentSubstitute(meta.getTablename()));
EtlLogger logger = new KettleEtlLogger(step);
loader = new InfobrightNamedPipeLoader(tableName, conn, logger, dataFormat, charset, agentPort);
loader.setTimeout(30);
String debugFile = meta.getDebugFile();
if (debugFile != null) {
OutputStream debugOutputStream = new FileOutputStream(debugFile);
loader.setDebugOutputStream(debugOutputStream);
}
record = loader.createRecord(false); // TODO set to true to support error path
loader.start();
} catch (Exception e) {
db.disconnect();
db = null;
if (loader != null) {
try {
loader.killQuery();
} catch (SQLException e1) {
throw new KettleDatabaseException(e1);
}
}
throw new KettleDatabaseException(e);
}
}
示例3: databaseSetup
import com.infobright.io.InfobrightNamedPipeLoader; //导入方法依赖的package包/类
void databaseSetup(InfobrightLoaderMeta meta, InfobrightLoader step) throws KettleException {
db = new Database(step, meta.getDatabaseMeta());
db.connect();
// FIXME: This will fail if the first row of the table contains a value that
// cannot be read by Java. For example, a DATE field that contains the value
// '0000-00-00'. In this case, the Kettle error message will misleadingly say
// that the table doesn't exist. There doesn't seem to be any workaround.
// See Pentaho JIRA: PDI-2117.
//
requiredRowMeta = meta.getRequiredFields(step);
requiredFields = requiredRowMeta.getFieldNames();
try {
// once the loader is built, this db connection cannot be used by this thread anymore.
// the loader is using it and any other uses of the connection will block.
if (meta.getInfobrightProductType() == null) {
meta.setDataFormat(DataFormat.TXT_VARIABLE); // default for ICE
}
DataFormat dataFormat = DataFormat.valueForDisplayName(meta.getInfobrightProductType());
int agentPort = meta.getAgentPort();
Charset charset = meta.getCharset();
Connection conn = db.getConnection();
String tableName = meta.getDatabaseMeta().getQuotedSchemaTableCombination(step.environmentSubstitute(meta.getSchemaName()), step.environmentSubstitute(meta.getTableName()));
EtlLogger logger = new KettleEtlLogger(step);
loader = new InfobrightNamedPipeLoader(tableName, conn, logger, dataFormat, charset, agentPort);
loader.setTimeout(30);
String debugFile = meta.getDebugFile();
if (debugFile != null) {
OutputStream debugOutputStream = new FileOutputStream(debugFile);
loader.setDebugOutputStream(debugOutputStream);
}
record = loader.createRecord(false); // TODO set to true to support error path
loader.start();
} catch (Exception e) {
db.disconnect();
db = null;
if (loader != null) {
try {
loader.killQuery();
} catch (SQLException e1) {
throw new KettleDatabaseException(e1);
}
}
throw new KettleDatabaseException(e);
}
}
示例4: databaseSetup
import com.infobright.io.InfobrightNamedPipeLoader; //导入方法依赖的package包/类
void databaseSetup( InfobrightLoaderMeta meta, InfobrightLoader step ) throws KettleException {
db = new Database( step, meta.getDatabaseMeta() );
db.connect();
// FIXME: This will fail if the first row of the table contains a value that
// cannot be read by Java. For example, a DATE field that contains the value
// '0000-00-00'. In this case, the Kettle error message will misleadingly say
// that the table doesn't exist. There doesn't seem to be any workaround.
// See Pentaho JIRA: PDI-2117.
//
requiredRowMeta = meta.getRequiredFields( step );
requiredFields = requiredRowMeta.getFieldNames();
try {
// once the loader is built, this db connection cannot be used by this thread anymore.
// the loader is using it and any other uses of the connection will block.
if ( meta.getInfobrightProductType() == null ) {
meta.setDataFormat( DataFormat.TXT_VARIABLE ); // default for ICE
}
DataFormat dataFormat = DataFormat.valueForDisplayName( meta.getInfobrightProductType() );
int agentPort = meta.getAgentPort();
Charset charset = meta.getCharset();
Connection conn = db.getConnection();
String tableName =
meta
.getDatabaseMeta().getQuotedSchemaTableCombination(
step.environmentSubstitute( meta.getSchemaName() ),
step.environmentSubstitute( meta.getTableName() ) );
EtlLogger logger = new KettleEtlLogger( step );
loader = new InfobrightNamedPipeLoader( tableName, conn, logger, dataFormat, charset, agentPort );
loader.setTimeout( 30 );
String debugFile = meta.getDebugFile();
if ( debugFile != null ) {
OutputStream debugOutputStream = new FileOutputStream( debugFile );
loader.setDebugOutputStream( debugOutputStream );
}
record = loader.createRecord( false ); // TODO set to true to support error path
loader.start();
} catch ( Exception e ) {
db.disconnect();
db = null;
if ( loader != null ) {
try {
loader.killQuery();
} catch ( SQLException e1 ) {
throw new KettleDatabaseException( e1 );
}
}
throw new KettleDatabaseException( e );
}
}