本文整理汇总了Java中org.pentaho.di.trans.step.errorhandling.Stream类的典型用法代码示例。如果您正苦于以下问题:Java Stream类的具体用法?Java Stream怎么用?Java Stream使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Stream类属于org.pentaho.di.trans.step.errorhandling包,在下文中一共展示了Stream类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: clone
import org.pentaho.di.trans.step.errorhandling.Stream; //导入依赖的package包/类
public Object clone() {
MergeJoinMeta retval = (MergeJoinMeta) super.clone();
int nrKeys1 = keyFields1.length;
int nrKeys2 = keyFields2.length;
retval.allocate( nrKeys1, nrKeys2 );
System.arraycopy( keyFields1, 0, retval.keyFields1, 0, nrKeys1 );
System.arraycopy( keyFields2, 0, retval.keyFields2, 0, nrKeys2 );
StepIOMetaInterface stepIOMeta = new StepIOMeta( true, true, false, false, false, false );
List<StreamInterface> infoStreams = getStepIOMeta().getInfoStreams();
for ( StreamInterface infoStream : infoStreams ) {
stepIOMeta.addStream( new Stream( infoStream ) );
}
retval.ioMeta = stepIOMeta;
return retval;
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:19,代码来源:MergeJoinMeta.java
示例2: mockProcessRowMeta
import org.pentaho.di.trans.step.errorhandling.Stream; //导入依赖的package包/类
private StreamLookupMeta mockProcessRowMeta( boolean memoryPreservationActive ) throws KettleStepException {
StreamLookupMeta meta = smh.processRowsStepMetaInterface;
StepMeta lookupStepMeta = when( mock( StepMeta.class ).getName() ).thenReturn( "Lookup" ).getMock();
doReturn( lookupStepMeta ).when( smh.transMeta ).findStep( "Lookup" );
StepIOMeta stepIOMeta = new StepIOMeta( true, true, false, false, false, false );
stepIOMeta.addStream( new Stream( StreamInterface.StreamType.INFO, lookupStepMeta, null, StreamIcon.INFO, null ) );
doReturn( stepIOMeta ).when( meta ).getStepIOMeta();
doReturn( new String[] { "Id" } ).when( meta ).getKeylookup();
doReturn( new String[] { "Id" } ).when( meta ).getKeystream();
doReturn( new String[] { "Value" } ).when( meta ).getValue();
doReturn( memoryPreservationActive ).when( meta ).isMemoryPreservationActive();
doReturn( false ).when( meta ).isUsingSortedList();
doReturn( false ).when( meta ).isUsingIntegerPair();
doReturn( new int[] { -1 } ).when( meta ).getValueDefaultType();
doReturn( new String[] { "" } ).when( meta ).getValueDefault();
doReturn( new String[] { "Value" } ).when( meta ).getValueName();
doReturn( new String[] { "Value" } ).when( meta ).getValue();
doCallRealMethod().when( meta ).getFields( any( RowMetaInterface.class ), anyString(), any( RowMetaInterface[].class ), any( StepMeta.class ),
any( VariableSpace.class ), any( Repository.class ), any( IMetaStore.class ) );
return meta;
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:26,代码来源:StreamLookupTest.java
示例3: readRep
import org.pentaho.di.trans.step.errorhandling.Stream; //导入依赖的package包/类
public void readRep(Repository rep, ObjectId id_step, List<DatabaseMeta> databases, Map<String, Counter> counters)
throws KettleException
{
try
{
int nrKeys = rep.countNrStepAttributes(id_step, "keys"); //$NON-NLS
allocateKeys(nrKeys);
for (int i=0;i<nrKeys;i++)
{
keyFields[i] = rep.getStepAttributeString(id_step, i, "keys"); //$NON-NLS-1$
}
long nInputStreams = rep.getStepAttributeInteger(id_step, "number_imput");
for (int i = 0; i < nInputStreams; i++) {
getStepIOMeta().addStream(new Stream(StreamType.INFO, null,
BaseMessages.getString(PKG, "MultiMergeJoin.InfoStream.Description"),
StreamIcon.INFO, null));
}
List<StreamInterface> infoStreams = getStepIOMeta().getInfoStreams();
for (int i=0; i < infoStreams.size(); i++)
infoStreams.get(i).setSubject( rep.getStepAttributeString (id_step, "step"+i) ); //$NON-NLS-1$
joinType = rep.getStepAttributeString(id_step, "join_type"); //$NON-NLS-1$
}
catch(Exception e)
{
throw new KettleException(BaseMessages.getString(PKG, "MultiMergeJoinMeta.Exception.UnexpectedErrorReadingStepInfo"), e); //$NON-NLS-1$
}
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:33,代码来源:MultiMergeJoinMeta.java
示例4: getMeta
import org.pentaho.di.trans.step.errorhandling.Stream; //导入依赖的package包/类
/**
* Get the meta data
* @param meta
*/
private void getMeta(MultiMergeJoinMeta meta)
{
List<StreamInterface> infoStreams = meta.getStepIOMeta().getInfoStreams();
if (infoStreams.size() == 0 ) {
if (inputSteps != null && inputSteps.length != 0) {
for (int i = 0; i < inputSteps.length; i++)
meta.getStepIOMeta().addStream(new Stream(StreamType.INFO, null,
BaseMessages.getString(PKG, "MultiMergeJoin.InfoStream.Description"),
StreamIcon.INFO, null));
infoStreams = meta.getStepIOMeta().getInfoStreams();
}
}
else if(inputSteps != null && infoStreams.size() < inputSteps.length )
{
int requiredStreams = inputSteps.length - infoStreams.size() ;
for (int i = 0; i < requiredStreams; i++)
meta.getStepIOMeta().addStream(new Stream(StreamType.INFO, null,
BaseMessages.getString(PKG, "MultiMergeJoin.InfoStream.Description"),
StreamIcon.INFO, null));
infoStreams = meta.getStepIOMeta().getInfoStreams();
}
int streamCount = infoStreams.size();
meta.allocateInputSteps(streamCount);
meta.allocateKeys(streamCount);
for (int i = 0; i < streamCount; i++)
{
meta.getInputSteps()[i] = wInputStepArray[i].getText();
infoStreams.get(i).setStepMeta( transMeta.findStep( wInputStepArray[i].getText()) );
meta.getKeyFields()[i] = keyValTextBox[i].getText();
}
meta.setJoinType(joinTypeCombo.getText());
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:40,代码来源:MultiMergeJoinDialog.java
示例5: searchInfoAndTargetSteps
import org.pentaho.di.trans.step.errorhandling.Stream; //导入依赖的package包/类
@Override
public void searchInfoAndTargetSteps( List<StepMeta> steps ) {
getStepIOMeta().getInfoStreams().clear();
for ( int i = 0; i < inputSteps.length; i++ ) {
String inputStepName = inputSteps[i];
if ( i >= getStepIOMeta().getInfoStreams().size() ) {
getStepIOMeta().addStream(
new Stream( StreamType.INFO, StepMeta.findStep( steps, inputStepName ),
BaseMessages.getString( PKG, "MultiMergeJoin.InfoStream.Description" ), StreamIcon.INFO, inputStepName ) );
}
}
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:13,代码来源:MultiMergeJoinMeta.java
示例6: clone
import org.pentaho.di.trans.step.errorhandling.Stream; //导入依赖的package包/类
@Override
public Object clone() {
try {
BaseStepMeta retval = (BaseStepMeta) super.clone();
// PDI-15799: Makes a copy of the StepMeta. This copy can be used within the same Transformation.
// That means than inner step references are copied rather then cloned.
// If the copy is acquired for another Transformation (e.g. this method is called from Transformation.clone() )
// then the step references must be corrected.
if ( ioMeta != null ) {
StepIOMetaInterface stepIOMeta = new StepIOMeta( ioMeta.isInputAcceptor(), ioMeta.isOutputProducer(), ioMeta.isInputOptional(), ioMeta.isSortedDataRequired(), ioMeta.isInputDynamic(), ioMeta.isOutputDynamic() );
List<StreamInterface> infoStreams = ioMeta.getInfoStreams();
for ( StreamInterface infoStream : infoStreams ) {
stepIOMeta.addStream( new Stream( infoStream ) );
}
List<StreamInterface> targetStreams = ioMeta.getTargetStreams();
for ( StreamInterface targetStream : targetStreams ) {
stepIOMeta.addStream( new Stream( targetStream ) );
}
retval.ioMeta = stepIOMeta;
}
return retval;
} catch ( CloneNotSupportedException e ) {
return null;
}
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:31,代码来源:BaseStepMeta.java
示例7: run
import org.pentaho.di.trans.step.errorhandling.Stream; //导入依赖的package包/类
@Override
public void run() {
try {
for ( int i = 0; i < cycles; i++ ) {
Stream stream = new Stream( StreamInterface.StreamType.INPUT, null, null, null, null );
meta.addStream( stream );
}
} catch ( Exception e ) {
this.exception = e;
}
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:12,代码来源:StepIOMetaIT.java
示例8: readData
import org.pentaho.di.trans.step.errorhandling.Stream; //导入依赖的package包/类
private void readData(Node stepnode) throws KettleXMLException
{
try
{
Node keysNode = XMLHandler.getSubNode(stepnode, "keys"); //$NON-NLS-1$
int nrKeys = XMLHandler.countNodes(keysNode, "key"); //$NON-NLS-1$
allocateKeys(nrKeys);
for (int i=0;i<nrKeys;i++)
{
Node keynode = XMLHandler.getSubNodeByNr(keysNode, "key", i); //$NON-NLS-1$
keyFields[i] = XMLHandler.getNodeValue(keynode);
}
int nInputStreams = Integer.parseInt(XMLHandler.getTagValue(stepnode, "number_input"));
allocateInputSteps(nInputStreams);
for (int i = 0; i < nInputStreams; i++) {
getStepIOMeta().addStream(new Stream(StreamType.INFO, null,
BaseMessages.getString(PKG, "MultiMergeJoin.InfoStream.Description"),
StreamIcon.INFO, null));
}
List<StreamInterface> infoStreams = getStepIOMeta().getInfoStreams();
for (int i = 0; i < infoStreams.size(); i++)
{
String stepName=XMLHandler.getTagValue(stepnode, "step"+i);
infoStreams.get(i).setSubject(stepName ); //$NON-NLS-1$
inputSteps[i]=stepName;
}
joinType = XMLHandler.getTagValue(stepnode, "join_type"); //$NON-NLS-1$
}
catch(Exception e)
{
throw new KettleXMLException(BaseMessages.getString(PKG, "MultiMergeJoinMeta.Exception.UnableToLoadStepInfo"), e); //$NON-NLS-1$
}
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:43,代码来源:MultiMergeJoinMeta.java
示例9: getTargetStepName
import org.pentaho.di.trans.step.errorhandling.Stream; //导入依赖的package包/类
private String getTargetStepName( int streamIndex ) {
StreamInterface stream = getStepIOMeta().getTargetStreams().get( streamIndex );
return java.util.stream.Stream.of( stream.getStepname(), stream.getSubject() )
.filter( Objects::nonNull )
.findFirst().map( Object::toString ).orElse( null );
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:7,代码来源:FilterRowsMeta.java
示例10: testCloneWithInfoSteps
import org.pentaho.di.trans.step.errorhandling.Stream; //导入依赖的package包/类
@Test
public void testCloneWithInfoSteps() throws Exception {
final Database db1 = mock( Database.class );
final Database db2 = mock( Database.class );
final Repository repository = mock( Repository.class );
final StepMeta stepMeta = mock( StepMeta.class );
BaseStepMeta meta = new BaseStepMeta();
meta.setChanged( true );
meta.databases = new Database[] { db1, db2 };
meta.ioMeta = new StepIOMeta( true, false, false, false, false, false );
final String refStepName = "referenced step";
final StepMeta refStepMeta = mock( StepMeta.class );
doReturn( refStepName ).when( refStepMeta ).getName();
StreamInterface stream = new Stream( StreamInterface.StreamType.INFO, refStepMeta, null, null, refStepName );
meta.ioMeta.addStream( stream );
meta.repository = repository;
meta.parentStepMeta = stepMeta;
BaseStepMeta clone = (BaseStepMeta) meta.clone();
assertTrue( clone.hasChanged() );
// is it OK ?
assertTrue( clone.databases == meta.databases );
assertArrayEquals( meta.databases, clone.databases );
assertEquals( meta.repository, clone.repository );
assertEquals( meta.parentStepMeta, clone.parentStepMeta );
assertNotNull( clone.ioMeta );
assertEquals( meta.ioMeta.isInputAcceptor(), clone.ioMeta.isInputAcceptor() );
assertEquals( meta.ioMeta.isInputDynamic(), clone.ioMeta.isInputDynamic() );
assertEquals( meta.ioMeta.isInputOptional(), clone.ioMeta.isInputOptional() );
assertEquals( meta.ioMeta.isOutputDynamic(), clone.ioMeta.isOutputDynamic() );
assertEquals( meta.ioMeta.isOutputProducer(), clone.ioMeta.isOutputProducer() );
assertEquals( meta.ioMeta.isSortedDataRequired(), clone.ioMeta.isSortedDataRequired() );
final List<StreamInterface> clonedInfoStreams = clone.ioMeta.getInfoStreams();
assertNotNull( clonedInfoStreams );
assertEquals( 1, clonedInfoStreams.size() );
final StreamInterface clonedStream = clonedInfoStreams.get( 0 );
assertNotSame( stream, clonedStream );
assertEquals( stream.getStreamType(), clonedStream.getStreamType() );
assertEquals( refStepName, clonedStream.getStepname() );
assertSame( refStepMeta, clonedStream.getStepMeta() ); // PDI-15799
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:50,代码来源:BaseStepMetaCloningTest.java
注:本文中的org.pentaho.di.trans.step.errorhandling.Stream类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论