【Kettle实战】作业和转换任务文件

默认kettle保存文件是在本地文件系统。其他可选HDFS等

Docker部署KettleWeb 

# 拉取镜像
docker pull hiromuhota/webspoon
 
# 启动镜像
docker run -d --name kettle-web -p 8080:8080 hiromuhota/webspoon 
 
# 测试访问
http://localhost:8080/spoon/spoon
 
#配置中文化(root权限)
docker exec -it -u 0 kettle-web /bin/bash
 
# 清空/etc/apt/sources.list文件
echo > /etc/apt/sources.list
 
echo -e "deb http://mirrors.aliyun.com/debian/ stretch main non-free contrib \ndeb-src http://mirrors.aliyun.com/debian/ stretch main non-free contrib \ndeb http://mirrors.aliyun.com/debian-security stretch/updates main \ndeb-src http://mirrors.aliyun.com/debian-security stretch/updates main \ndeb http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib \ndeb-src http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib \ndeb http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib \ndeb-src http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib" > /etc/apt/sources.list
apt-get update
apt-get install -y libtinfo5 --allow-remove-essential
apt-get install -y vim
 
cd /usr/local/tomcat/bin
vim setenv.sh 
 
# 汉化配置,在文件末尾追加这如下两项内容配置
CATALINA_OPTS="-Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true"
JAVA_OPTS="-Duser.language=zh -Duser.region=CN -Dfile.encoding=UTF-8"
 
docker restart kettle-web

Spoon.java部分源码

#Spoon.java部分源码
public boolean saveFileAs() throws KettleException {
    try {
      EngineMetaInterface meta = getActiveMeta();
      if ( meta != null && AbstractMeta.class.isAssignableFrom( meta.getClass() ) ) {
        if ( ( (AbstractMeta) meta ).hasMissingPlugins() ) {
          MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
          mb.setMessage( BaseMessages.getString( PKG, "Spoon.ErrorDialog.MissingPlugin.Error" ) );
          mb.setText( BaseMessages.getString( PKG, "Spoon.ErrorDialog.MissingPlugin.Title" ) );
          mb.open();
          return false;
        }
      }
      if ( meta != null ) {
        if ( meta.canSave() ) {
          return saveFileAs( meta );
        }
      }
    } catch ( Exception e ) {
      KettleRepositoryLostException krle = KettleRepositoryLostException.lookupStackStrace( e );
      if ( krle != null ) {
        new ErrorDialog( shell,
            BaseMessages.getString( PKG, "Spoon.File.Save.Fail.Title" ),
            krle.getPrefaceMessage(),
            krle );
        closeRepository();
      } else {
        new ErrorDialog( shell,
            BaseMessages.getString( PKG, "Spoon.File.Save.Fail.Title" ),
            BaseMessages.getString( PKG, "Spoon.File.Save.Fail.Message" ), e );
      }
    }

保存文件流程

另存或保存时都会先保存文件内容。

保存文件方式

作业后缀是*.kjb,转换后缀是*.ktr

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值