zoukankan      html  css  js  c++  java
  • Flume(三) —— 断点续传 与 事务

    断点续传

    # Name the components on this agent
    a1.sources = r1
    a1.sinks = k1
    a1.channels = c1
    
    # Describe / configure the source
    a1.sources.r1.type = TAILDIR
    a1.sources.r1.filegroups = f1 f2
    a1.sources.r1.filegroups.f1 = /usr/local/flume/example/file1.txt
    a1.sources.r1.filegroups.f2 = /usr/local/flume/example/file2.txt
    a1.sources.r1.positionFile = /usr/local/flume/position/postition.json
    
    
    # Describe the sink
    a1.sinks.k1.type = logger
    
    # Use a channel which buffers events in memory
    a1.channels.c1.type = memory
    a1.channels.c1.capacity = 1000
    a1.channels.c1.transactionCapacity = 100
    
    # Bind the source and sink to the channel
    a1.sources.r1.channels = c1
    a1.sinks.k1.channel = c1
    

    执行

    ./bin/flume-ng agent -c conf/ -f job/file-flume-point-logger.conf -n a1 -Dflume.root.logger=INFO,console
    

    运行结果

    原理

    在配置的/usr/local/flume/position/postition.json文件中,会发现,flume将位置信息记录在这个postition中。

    [{"inode":33855378,"pos":23,"file":"/usr/local/flume/example/file1.txt"},{"inode":33855380,"pos":36,"file":"/usr/local/flume/example/file2.txt"}]
    

    事务

    put事务和take事务

  • 相关阅读:
    Project Euler 389 Platonic Dice (概率)
    单纯形(相关题目)
    关于C++中的内存泄露
    莫比乌斯反演与积性函数求和筛法中的一些细节
    清华集训2015-Day 2
    bzoj3456-城市规划
    多项式运算的一些技术
    bzoj2302-Problem c
    bzoj4300-绝世好题
    bzoj4726-Sabota?
  • 原文地址:https://www.cnblogs.com/fonxian/p/12189425.html
Copyright © 2011-2022 走看看