当前位置: 首页>>代码示例>>Java>>正文


Java ValueMetaInterface.getStorageMetadata方法代码示例

本文整理汇总了Java中org.pentaho.di.core.row.ValueMetaInterface.getStorageMetadata方法的典型用法代码示例。如果您正苦于以下问题:Java ValueMetaInterface.getStorageMetadata方法的具体用法?Java ValueMetaInterface.getStorageMetadata怎么用?Java ValueMetaInterface.getStorageMetadata使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.pentaho.di.core.row.ValueMetaInterface的用法示例。


在下文中一共展示了ValueMetaInterface.getStorageMetadata方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: processRow

import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
public boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException {

    Object[] r = getRow(); // get row, set busy!
    // no more input to be expected...
    if ( r == null ) {
      // This is an input step, so if there are no incoming rows, we should still execute
      if ( !first ) {
        setOutputDone();
        return false;
      }
    }

    if ( first ) {
      first = false;

    }

    RowMetaInterface outputRowMeta = new RowMeta();
    meta.getFields( outputRowMeta, getStepname(), null, null, this, repository, metaStore );
    Object[] outputRow = new Object[outputRowMeta.size()];

    // Fetch the field values using the given paths
    try {
      List<ZooKeeperField> fields = meta.getFields();
      if ( fields != null ) {
        int i = 0;
        for ( ZooKeeperField field : fields ) {
          Stat dataStat = new Stat();
          byte[] bytes = zk.getData( field.getPath(), false, dataStat );
          if ( bytes != null ) {
            // Get data as string and convert it to the specified type
            ValueMetaInterface type = field.getType();
            if(type.getStorageMetadata() == null) {
              type.setStorageMetadata( new ValueMetaString("data") );
            }
            outputRow[i] = type.convertBinaryStringToNativeType( bytes );
          }
          i++;
          incrementLinesInput();
        }
      }
    } catch ( Exception e ) {
      throw new KettleException( e );
    }

    putRow( outputRowMeta, outputRow ); // copy row to possible alternate rowset(s).

    if ( checkFeedback( getLinesRead() ) ) {
      if ( log.isBasic() ) {
        logBasic( BaseMessages.getString( PKG, "ZooKeeperInput.Log.LineNumber" ) + getLinesRead() );
      }
    }

    return true;
  }
 
开发者ID:mattyb149,项目名称:pdi-zookeeper,代码行数:56,代码来源:ZooKeeperInput.java


注:本文中的org.pentaho.di.core.row.ValueMetaInterface.getStorageMetadata方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。