本文整理匯總了Java中org.pentaho.di.trans.step.StepDataInterface類的典型用法代碼示例。如果您正苦於以下問題:Java StepDataInterface類的具體用法?Java StepDataInterface怎麽用?Java StepDataInterface使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
StepDataInterface類屬於org.pentaho.di.trans.step包,在下文中一共展示了StepDataInterface類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: init
import org.pentaho.di.trans.step.StepDataInterface; //導入依賴的package包/類
@Override
public boolean init( StepMetaInterface smi, StepDataInterface sdi ) {
if ( !super.init( smi, sdi ) ) {
return false;
}
meta = (ZendeskInputMeta) smi;
data = (ZendeskInputData) sdi;
String subDomain = environmentSubstitute( meta.getSubDomain() );
String username = environmentSubstitute( meta.getUsername() );
String password = Encr.decryptPasswordOptionallyEncrypted( environmentSubstitute( meta.getPassword() ) );
if ( Const.isEmpty( subDomain ) || Const.isEmpty( username ) || Const.isEmpty( password ) ) {
logError( BaseMessages.getString( PKG, "ZendeskInput.Error.MissingCredentials" ) );
return false;
}
data.conn = createConnection( subDomain, username, password, meta.isToken() );
if ( data.conn == null || data.conn.isClosed() ) {
return false;
}
return true;
}
示例2: dispose
import org.pentaho.di.trans.step.StepDataInterface; //導入依賴的package包/類
public void dispose(StepMetaInterface smi, StepDataInterface sdi) {
try {
if (data.recordWriter != null) {
data.recordWriter.close();
}
if (data.uploadSession != null) {
data.uploadSession.commit();
}
} catch (IOException e) {
logError(e.getMessage(), e);
} catch (TunnelException ex) {
logError(ex.getMessage(), ex);
}
super.dispose(smi, sdi);
}
示例3: init
import org.pentaho.di.trans.step.StepDataInterface; //導入依賴的package包/類
@Override
public boolean init(StepMetaInterface smi, StepDataInterface sdi) {
this.meta = ((CassandraInputMeta) smi);
this.data = ((CassandraInputData) sdi);
String nodes = environmentSubstitute(this.meta.getCassandraNodes());
String port = environmentSubstitute(this.meta.getCassandraPort());
String username = environmentSubstitute(this.meta.getUsername());
String password = environmentSubstitute(this.meta.getPassword());
String keyspace = environmentSubstitute(this.meta.getKeyspace());
Boolean withSSL = this.meta.getSslEnabled();
String trustStoreFilePath = environmentSubstitute(this.meta.getTrustStoreFilePath());
String trustStorePass = environmentSubstitute(this.meta.getTrustStorePass());
String compression = environmentSubstitute(this.meta.getCompression().name());
this.executeForEachInputRow = this.meta.getExecuteForEachInputRow();
this.rowLimit = this.meta.getRowLimit();
this.cqlStatement = environmentSubstitute(this.meta.getCqlStatement());
try {
this.connection = Utils.connect(nodes, port, username, password, keyspace, withSSL,
trustStoreFilePath, trustStorePass, ConnectionCompression.fromString(compression));
} catch (CassandraConnectionException e) {
logError("Could not initialize step: " + e.getMessage());
}
logDetailed("Init connection OK : "+this.connection);
return super.init(this.meta, this.data);
}
示例4: processRow
import org.pentaho.di.trans.step.StepDataInterface; //導入依賴的package包/類
public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws KettleException {
meta = (EasyExpandMeta) smi;
data = (EasyExpandData) sdi;
if(StringUtils.isNotBlank(meta.getClassName())){
try {
//實例化配置的類
if(first){
kui = (EasyExpandRunBase) Class.forName(
environmentSubstitute(meta.getClassName())).newInstance();
kui.setKu(this);
kui.setMeta(meta,this);
}
kui.setData(data);
return kui.run();
} catch (Exception e) {
setErrors(getErrors()+1);
logError("運行失敗,"+meta.getClassName()+","+Arrays.toString(getRow())+","
+environmentSubstitute(meta.getConfigInfo()), e);
return defaultRun();
}
}else{
return defaultRun();
}
}
示例5: processRow
import org.pentaho.di.trans.step.StepDataInterface; //導入依賴的package包/類
public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws KettleException {
meta = (EasyExpandMeta) smi;
data = (EasyExpandData) sdi;
if(StringUtils.isNotBlank(meta.getClassName())){
try {
//實例化配置的類
if(first){
kui = (EasyExpandRunBase) Class.forName(
environmentSubstitute(meta.getClassName())).newInstance();
kui.setKu(this);
kui.setMeta(meta,this);
}
kui.setData(data);
return kui.run();
} catch (Exception e) {
setErrors(getErrors()+1);
logError("運行失敗,"+meta.getClassName()+","
+environmentSubstitute(meta.getConfigInfo()), e);
return defaultRun();
}
}else{
return defaultRun();
}
}
示例6: init
import org.pentaho.di.trans.step.StepDataInterface; //導入依賴的package包/類
public boolean init(StepMetaInterface smi, StepDataInterface sdi) {
meta = (DOMConcatFieldsMeta) smi;
data = (DOMConcatFieldsData) sdi;
if (!super.init(smi, sdi)) {
return false;
}
try {
data.documentBuilder = DocumentBuilderFactory.newInstance()
.newDocumentBuilder();
} catch (ParserConfigurationException e) {
logError("Could not create a document builder", e);
return false;
}
return true;
}
示例7: dispose
import org.pentaho.di.trans.step.StepDataInterface; //導入依賴的package包/類
public void dispose(StepMetaInterface smi, StepDataInterface sdi) {
try {
if (data.tunnelRecordReader != null) {
data.tunnelRecordReader.close();
}
} catch (IOException e) {
logError(e.getMessage(), e);
}
super.dispose(smi, sdi);
}
示例8: init
import org.pentaho.di.trans.step.StepDataInterface; //導入依賴的package包/類
@Override
public boolean init(StepMetaInterface smi, StepDataInterface sdi) {
if (super.init(smi, sdi)) {
this.meta = ((CassandraOutputMeta) smi);
this.nodes = environmentSubstitute(this.meta.getCassandraNodes());
this.port = environmentSubstitute(this.meta.getCassandraPort());
this.username = environmentSubstitute(this.meta.getUsername());
this.password = environmentSubstitute(this.meta.getPassword());
this.keyspace = environmentSubstitute(this.meta.getKeyspace());
this.columnfamily = environmentSubstitute(this.meta.getColumnfamily());
this.SslEnabled = this.meta.getSslEnabled();
this.truststoreFilePath = environmentSubstitute(this.meta.getTrustStoreFilePath());
this.truststorepass = environmentSubstitute(this.meta.getTrustStorePass());
this.compression = this.meta.getCompression();
this.syncModeEnabled = this.meta.isSyncMode();
this.maxOpenQueue = (this.syncModeEnabled ? 0 : this.meta.getBatchSize());
try {
if (Const.isEmpty(this.columnfamily)) {
throw new RuntimeException(BaseMessages.getString(CassandraOutputMeta.PKG,
"CassandraOutput.Error.NoColumnFamilySpecified", new String[0]));
}
if ((this.meta.isSpecifyFields()) && (this.meta.getCassandraFields().length != this.meta.getStreamFields().length)) {
throw new RuntimeException(BaseMessages.getString(CassandraOutputMeta.PKG,
"CassandraOutput.Error.InitializationColumnProblem", new String[0]));
}
this.connection = Utils.connect(this.nodes, this.port, this.username, this.password,
this.keyspace, this.SslEnabled, this.truststoreFilePath, this.truststorepass, this.compression);
return true;
} catch (Exception ex) {
logError(BaseMessages.getString(CassandraOutputMeta.PKG,"CassandraOutput.Error.InitializationProblem"), ex);
}
}
return false;
}
示例9: dispose
import org.pentaho.di.trans.step.StepDataInterface; //導入依賴的package包/類
@Override
public void dispose(StepMetaInterface smi, StepDataInterface sdi) {
if (this.connection != null) {
this.connection.release();
}
super.dispose(this.meta, this.data);
}
示例10: init
import org.pentaho.di.trans.step.StepDataInterface; //導入依賴的package包/類
@Override
public boolean init(StepMetaInterface smi, StepDataInterface sdi) {
GetStreamingCacheData data = (GetStreamingCacheData) sdi;
data.rowIndex = 0;
return super.init(smi, sdi);
}
示例11: init
import org.pentaho.di.trans.step.StepDataInterface; //導入依賴的package包/類
@Override
public boolean init(StepMetaInterface smi, StepDataInterface sdi) {
HCPGetMeta meta = (HCPGetMeta) smi;
HCPGetData data = (HCPGetData) sdi;
boolean error = false;
if (meta.getConnection() == null) {
log.logError(BaseMessages.getString(PKG, "HCPGet.Error.HCPConnectionNotSpecified"));
error = true;
}
if (StringUtils.isEmpty(meta.getSourceFileField())) {
log.logError(BaseMessages.getString(PKG, "HCPGet.Error.SourceFileFieldNotSpecified"));
error = true;
}
if (StringUtils.isEmpty(meta.getTargetFileField())) {
log.logError(BaseMessages.getString(PKG, "HCPGet.Error.TargetFileFieldNotSpecified"));
error = true;
}
if (error) {
// Stop right here.
return false;
}
data.bufferSize = 1024;
data.authorization = meta.getConnection().getAuthorizationHeader();
data.client = ApacheHttpClient.create(new DefaultApacheHttpClientConfig());
data.client.setChunkedEncodingSize(data.bufferSize);
return super.init(smi, sdi);
}
示例12: dispose
import org.pentaho.di.trans.step.StepDataInterface; //導入依賴的package包/類
@Override
public void dispose(StepMetaInterface smi, StepDataInterface sdi) {
// HCPGetMeta meta = (HCPGetMeta) smi;
HCPGetData data = (HCPGetData) sdi;
data.client.destroy();
super.dispose(smi, sdi);
}
示例13: init
import org.pentaho.di.trans.step.StepDataInterface; //導入依賴的package包/類
@Override
public boolean init(StepMetaInterface smi, StepDataInterface sdi) {
HCPDeleteMeta meta = (HCPDeleteMeta) smi;
HCPDeleteData data = (HCPDeleteData) sdi;
boolean error = false;
if (meta.getConnection() == null) {
log.logError(BaseMessages.getString(PKG, "HCPDelete.Error.HCPConnectionNotSpecified"));
error = true;
}
if (StringUtils.isEmpty(meta.getTargetFileField())) {
log.logError(BaseMessages.getString(PKG, "HCPDelete.Error.TargetFileFieldNotSpecified"));
error = true;
}
if (error) {
// Stop right here.
return false;
}
data.bufferSize = 1024;
data.authorization = meta.getConnection().getAuthorizationHeader();
data.client = ApacheHttpClient.create(new DefaultApacheHttpClientConfig());
data.client.setChunkedEncodingSize(data.bufferSize);
return super.init(smi, sdi);
}
示例14: dispose
import org.pentaho.di.trans.step.StepDataInterface; //導入依賴的package包/類
@Override
public void dispose(StepMetaInterface smi, StepDataInterface sdi) {
// HCPDeleteMeta meta = (HCPDeleteMeta) smi;
HCPDeleteData data = (HCPDeleteData) sdi;
data.client.destroy();
super.dispose(smi, sdi);
}
示例15: init
import org.pentaho.di.trans.step.StepDataInterface; //導入依賴的package包/類
@Override
public boolean init(StepMetaInterface smi, StepDataInterface sdi) {
HCPPutMeta meta = (HCPPutMeta) smi;
HCPPutData data = (HCPPutData) sdi;
boolean error = false;
if (meta.getConnection() == null) {
log.logError(BaseMessages.getString(PKG, "HCPPut.Error.HCPConnectionNotSpecified"));
error = true;
}
if (StringUtils.isEmpty(meta.getSourceFileField())) {
log.logError(BaseMessages.getString(PKG, "HCPPut.Error.SourceFileFieldNotSpecified"));
error = true;
}
if (StringUtils.isEmpty(meta.getTargetFileField())) {
log.logError(BaseMessages.getString(PKG, "HCPPut.Error.TargetFileFieldNotSpecified"));
error = true;
}
if (error) {
// Stop right here.
return false;
}
data.bufferSize = 1024;
data.authorization = meta.getConnection().getAuthorizationHeader();
data.client = ApacheHttpClient.create(new DefaultApacheHttpClientConfig());
data.client.setChunkedEncodingSize(data.bufferSize);
return super.init(smi, sdi);
}