本文整理汇总了Java中com.infobright.etl.model.DataFormat类的典型用法代码示例。如果您正苦于以下问题:Java DataFormat类的具体用法?Java DataFormat怎么用?Java DataFormat使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataFormat类属于com.infobright.etl.model包,在下文中一共展示了DataFormat类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: loadXML
import com.infobright.etl.model.DataFormat; //导入依赖的package包/类
@Override
public void loadXML(Node stepnode, List<DatabaseMeta> databases, Map<String, Counter> counters)
throws KettleXMLException {
super.loadXML(stepnode, databases, counters);
try {
dataFormat = Enum.valueOf(DataFormat.class, XMLHandler.getTagValue(stepnode, TAG_DATA_FORMAT));
agentPort = Integer.parseInt(Const.NVL(XMLHandler.getTagValue(stepnode, TAG_AGENT_PORT),
Integer.toString(InfobrightNamedPipeLoader.AGENT_DEFAULT_PORT)));
String charsetName = XMLHandler.getTagValue(stepnode, TAG_CHARSET);
charset = (charsetName == null ? InfobrightNamedPipeLoader.DEFAULT_CHARSET :
Charset.forName(charsetName));
debugFile = XMLHandler.getTagValue(stepnode, TAG_DEBUG_FILE);
} catch(Exception e) {
throw new KettleXMLException("Unable to load step info from XML", e);
}
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:17,代码来源:InfobrightLoaderMeta.java
示例2: readRep
import com.infobright.etl.model.DataFormat; //导入依赖的package包/类
@Override
public void readRep(Repository rep, ObjectId id_step, List<DatabaseMeta> databases, Map<String, Counter> counters) throws KettleException {
super.readRep(rep, id_step, databases, counters);
try {
dataFormat = Enum.valueOf(DataFormat.class, rep.getStepAttributeString(id_step, TAG_DATA_FORMAT));
String agentPortStr = rep.getStepAttributeString(id_step, TAG_AGENT_PORT);
if (agentPortStr == null) {
agentPort = InfobrightNamedPipeLoader.AGENT_DEFAULT_PORT;
} else {
agentPort = Integer.parseInt(agentPortStr);
}
String charsetName = rep.getStepAttributeString(id_step, TAG_CHARSET);
charset = (charsetName == null ? InfobrightNamedPipeLoader.DEFAULT_CHARSET :
Charset.forName(charsetName));
debugFile = rep.getStepAttributeString(id_step, TAG_DEBUG_FILE);
} catch (Exception e) {
throw new KettleException("Unexpected error reading step information from the repository", e);
}
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:20,代码来源:InfobrightLoaderMeta.java
示例3: ok
import com.infobright.etl.model.DataFormat; //导入依赖的package包/类
protected void ok() {
try {
stepname = wStepname.getText(); // return value
meta.setDatabaseMeta( transMeta.findDatabase(serverConnection.getText()) );
meta.setSchemaName(targetSchemaText.getText());
meta.setTablename(targetTableText.getText());
meta.setDataFormat(DataFormat.valueForDisplayName(dataFormatSelect.getText()));
String charsetName = charsetSelect.getText();
Charset charset2 = ("".equals(charsetName) ?
InfobrightNamedPipeLoader.DEFAULT_CHARSET :
Charset.forName(charsetName));
meta.setCharset(charset2);
String agentPortStr = agentPortText.getText().trim();
if ("".equals(agentPortStr)) {
meta.setAgentPort(InfobrightNamedPipeLoader.AGENT_DEFAULT_PORT);
} else {
meta.setAgentPort(Integer.parseInt(agentPortStr));
}
meta.setDebugFile(debugFileText.getText());
dispose();
} catch(Exception e) {
new ErrorDialog(shell, BaseMessages.getString(PKG,
"InfobrightLoaderDialog.Illegal.Dialog.Settings.Title"),
BaseMessages.getString(PKG, "InfobrightLoaderDialog.Illegal.Dialog.Settings.Message"), e);
}
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:27,代码来源:InfobrightLoaderDialog.java
示例4: ok
import com.infobright.etl.model.DataFormat; //导入依赖的package包/类
protected void ok() {
try {
stepname = wStepname.getText(); // return value
meta.setDatabaseMeta( transMeta.findDatabase(serverConnection.getText()) );
meta.setSchemaName(targetSchemaText.getText());
meta.setTableName(targetTableText.getText());
meta.setDataFormat(DataFormat.valueForDisplayName(dataFormatSelect.getText()));
String charsetName = charsetSelect.getText();
Charset charset2 = ("".equals(charsetName) ?
InfobrightNamedPipeLoader.DEFAULT_CHARSET :
Charset.forName(charsetName));
meta.setCharset(charset2);
String agentPortStr = agentPortText.getText().trim();
if ("".equals(agentPortStr)) {
meta.setAgentPort(InfobrightNamedPipeLoader.AGENT_DEFAULT_PORT);
} else {
meta.setAgentPort(Integer.parseInt(agentPortStr));
}
meta.setDebugFile(debugFileText.getText());
dispose();
} catch(Exception e) {
new ErrorDialog(shell, BaseMessages.getString(PKG,
"InfobrightLoaderDialog.Illegal.Dialog.Settings.Title"),
BaseMessages.getString(PKG, "InfobrightLoaderDialog.Illegal.Dialog.Settings.Message"), e);
}
}
开发者ID:bsspirit,项目名称:kettle-4.4.0-stable,代码行数:27,代码来源:InfobrightLoaderDialog.java
示例5: loadXML
import com.infobright.etl.model.DataFormat; //导入依赖的package包/类
@Override
public void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ) throws KettleXMLException {
super.loadXML( stepnode, databases, metaStore );
try {
dataFormat = Enum.valueOf( DataFormat.class, XMLHandler.getTagValue( stepnode, TAG_DATA_FORMAT ) );
agentPort =
Integer.parseInt( Const.NVL( XMLHandler.getTagValue( stepnode, TAG_AGENT_PORT ), Integer
.toString( InfobrightNamedPipeLoader.AGENT_DEFAULT_PORT ) ) );
String charsetName = XMLHandler.getTagValue( stepnode, TAG_CHARSET );
charset =
( charsetName == null ? InfobrightNamedPipeLoader.DEFAULT_CHARSET : Charset.forName( charsetName ) );
debugFile = XMLHandler.getTagValue( stepnode, TAG_DEBUG_FILE );
} catch ( Exception e ) {
throw new KettleXMLException( "Unable to load step info from XML", e );
}
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:17,代码来源:InfobrightLoaderMeta.java
示例6: readRep
import com.infobright.etl.model.DataFormat; //导入依赖的package包/类
@Override
public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException {
super.readRep( rep, metaStore, id_step, databases );
try {
dataFormat = Enum.valueOf( DataFormat.class, rep.getStepAttributeString( id_step, TAG_DATA_FORMAT ) );
String agentPortStr = rep.getStepAttributeString( id_step, TAG_AGENT_PORT );
if ( agentPortStr == null ) {
agentPort = InfobrightNamedPipeLoader.AGENT_DEFAULT_PORT;
} else {
agentPort = Integer.parseInt( agentPortStr );
}
String charsetName = rep.getStepAttributeString( id_step, TAG_CHARSET );
charset =
( charsetName == null ? InfobrightNamedPipeLoader.DEFAULT_CHARSET : Charset.forName( charsetName ) );
debugFile = rep.getStepAttributeString( id_step, TAG_DEBUG_FILE );
} catch ( Exception e ) {
throw new KettleException( "Unexpected error reading step information from the repository", e );
}
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:20,代码来源:InfobrightLoaderMeta.java
示例7: ok
import com.infobright.etl.model.DataFormat; //导入依赖的package包/类
protected void ok() {
try {
stepname = wStepname.getText(); // return value
meta.setDatabaseMeta( transMeta.findDatabase( serverConnection.getText() ) );
meta.setSchemaName( targetSchemaText.getText() );
meta.setTableName( targetTableText.getText() );
meta.setDataFormat( DataFormat.valueForDisplayName( dataFormatSelect.getText() ) );
String charsetName = charsetSelect.getText();
Charset charset2 =
( "".equals( charsetName ) ? InfobrightNamedPipeLoader.DEFAULT_CHARSET : Charset.forName( charsetName ) );
meta.setCharset( charset2 );
String agentPortStr = agentPortText.getText().trim();
if ( "".equals( agentPortStr ) ) {
meta.setAgentPort( InfobrightNamedPipeLoader.AGENT_DEFAULT_PORT );
} else {
meta.setAgentPort( Integer.parseInt( agentPortStr ) );
}
meta.setDebugFile( debugFileText.getText() );
dispose();
} catch ( Exception e ) {
new ErrorDialog(
shell, BaseMessages.getString( PKG, "InfobrightLoaderDialog.Illegal.Dialog.Settings.Title" ),
BaseMessages.getString( PKG, "InfobrightLoaderDialog.Illegal.Dialog.Settings.Message" ), e );
}
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:26,代码来源:InfobrightLoaderDialog.java
示例8: InfobrightNamedPipeLoader
import com.infobright.etl.model.DataFormat; //导入依赖的package包/类
/**
* Constructs a new loader instance. No database action taken yet.
*
* @param tableName
* @param connection
* @param logger
* @param dataFormat
* @param charset
* @param agentPort the port number on the remote machine where the
* agent is running (defaults to 5555)
* @throws Exception
*/
public InfobrightNamedPipeLoader(String tableName, Connection
connection, EtlLogger logger, DataFormat dataFormat, Charset charset,
int agentPort)
throws Exception {
this.tableName = tableName;
this.connection = connection;
this.dataFormat = dataFormat;
this.logger = logger;
this.charset = charset;
String hostName = _getHostName(connection);
boolean isLocal = _isLocal(hostName);
// Use LOAD DATA LOCAL INFILE if (1) connection is remote; (2) local client
// is Linux/Unix; and (3) the IB release supports it. In this case all pipe
// operations are done locally using Unix semantics.
boolean useLocalInfile =
!isLocal && new OSType().isUnix() && new IBVersionUtil(connection).isSupportsLocalInfile();
if (isLocal || useLocalInfile) {
proxy = null;
factory = new NamedPipeFactory();
} else {
proxy = new ClientProxy(hostName, agentPort);
factory = new NamedPipeFactory(proxy);
}
strategy = factory.getStrategy(logger);
id = LoaderInstanceTracker.register(this);
// the named pipe name will be the prefix with a date/time stamp appended.
// since multiple loaders may be started in the same millisecond, we append the instance # to the
// end of the name to ensure uniqueness.
pipeName = String.format("%s_%tH_%<tM_%<tS_%<tL-%d", this.pipeNamePrefix, new Date(), id);
sql = dataFormat.getLoadSQL(getEscapedPipeName(pipeName), tableName, useLocalInfile);
}
开发者ID:EidosMedia,项目名称:infobright-core,代码行数:50,代码来源:InfobrightNamedPipeLoader.java
示例9: addCustomInputs
import com.infobright.etl.model.DataFormat; //导入依赖的package包/类
/**
* Adds any custom inputs
* @param prevControl
* @return the last control
*/
protected Control addCustomInputs(Control prevControl) {
String[] dataformats = new String[DataFormat.values().length];
int i = 0;
for (DataFormat format : DataFormat.values()) {
dataformats[i++] = format.getDisplayText();
}
dataFormatSelect = addStandardSelect(Messages.getString("InfobrightLoaderDialog.Dataformat.Label"), prevControl, dataformats);
targetSchemaText = addStandardTextVar(Messages.getString("InfobrightLoaderDialog.TargetSchema.Label"), dataFormatSelect);
targetTableText = addStandardTextVar(Messages.getString("InfobrightLoaderDialog.TargetTable.Label"), targetSchemaText);
//rejectInvalidRowsButton = addStandardCheckBox(Messages.getString("InfobrightLoaderDialog.RejectErrors.Label"), targetTableText);
return targetTableText;
}
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:20,代码来源:InfobrightLoaderDialog.java
示例10: ok
import com.infobright.etl.model.DataFormat; //导入依赖的package包/类
protected void ok() {
stepname = wStepname.getText(); // return value
meta.setDatabaseMeta( transMeta.findDatabase(serverConnection.getText()) );
meta.setSchemaName(targetSchemaText.getText());
meta.setTablename(targetTableText.getText());
meta.setDataFormat(DataFormat.valueForDisplayName(dataFormatSelect.getText()));
dispose();
}
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:10,代码来源:InfobrightLoaderDialog.java
示例11: setDefault
import com.infobright.etl.model.DataFormat; //导入依赖的package包/类
@Override
public void setDefault() {
this.dataFormat = DataFormat.TXT_VARIABLE; // default for ICE
// this.dataFormat = DataFormat.BINARY; // default for IEE
this.agentPort = InfobrightNamedPipeLoader.AGENT_DEFAULT_PORT;
this.charset = InfobrightNamedPipeLoader.DEFAULT_CHARSET;
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:8,代码来源:InfobrightLoaderMeta.java
示例12: getTestObject
import com.infobright.etl.model.DataFormat; //导入依赖的package包/类
@Override
public DataFormat getTestObject() {
DataFormat[] vals = DataFormat.values();
int dfNum = rand.nextInt( vals.length );
DataFormat rtn = vals[dfNum];
return rtn;
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:8,代码来源:InfobrightLoaderMetaTest.java
示例13: validateTestObject
import com.infobright.etl.model.DataFormat; //导入依赖的package包/类
@Override
public boolean validateTestObject( DataFormat testObject, Object actual ) {
if ( !( actual instanceof DataFormat ) ) {
return false;
}
DataFormat another = (DataFormat) actual;
return ( testObject.toString().equals( another.toString() ) );
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:9,代码来源:InfobrightLoaderMetaTest.java
示例14: ExecutionThread
import com.infobright.etl.model.DataFormat; //导入依赖的package包/类
ExecutionThread(Connection connection, DataFormat dataFormat, String pipeName) {
this.connection = connection;
this.dataFormat = dataFormat;
this.pipeName = pipeName;
}
开发者ID:EidosMedia,项目名称:infobright-core,代码行数:6,代码来源:InfobrightNamedPipeLoader.java
示例15: getDataFormat
import com.infobright.etl.model.DataFormat; //导入依赖的package包/类
private DataFormat getDataFormat() {
return dataFormat;
}
开发者ID:EidosMedia,项目名称:infobright-core,代码行数:4,代码来源:InfobrightNamedPipeLoader.java
示例16: databaseSetup
import com.infobright.etl.model.DataFormat; //导入依赖的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);
}
}
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:43,代码来源:InfobrightLoaderData.java
示例17: setDataFormat
import com.infobright.etl.model.DataFormat; //导入依赖的package包/类
public void setDataFormat(DataFormat dataFormat) {
this.dataFormat = dataFormat;
}
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:4,代码来源:InfobrightLoaderMeta.java
示例18: setDefault
import com.infobright.etl.model.DataFormat; //导入依赖的package包/类
public void setDefault() {
this.dataFormat = DataFormat.TXT_VARIABLE; // default for ICE
// this.dataFormat = DataFormat.BINARY; // default for IEE
}
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:5,代码来源:InfobrightLoaderMeta.java
示例19: loadXML
import com.infobright.etl.model.DataFormat; //导入依赖的package包/类
@Override
public void loadXML(Node stepnode, List<DatabaseMeta> databases, Map<String, Counter> counters)
throws KettleXMLException {
super.loadXML(stepnode, databases, counters);
dataFormat = Enum.valueOf(DataFormat.class, XMLHandler.getTagValue(stepnode, "data_format"));
}
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:7,代码来源:InfobrightLoaderMeta.java
示例20: databaseSetup
import com.infobright.etl.model.DataFormat; //导入依赖的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);
}
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:50,代码来源:InfobrightLoaderData.java
注:本文中的com.infobright.etl.model.DataFormat类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论