Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

flume ftp source, notas de desarrollo

Luis Lázaro edited this page Feb 4, 2015 · 1 revision

inputstream.skip(long bytes)

retrieved stream from FTPClient does not support mark(int limit) and reset natives methods from inputStream...

The only two input stream classes in java.io that always support marking are BufferedInputStream and ByteArrayInputStream .>

ByteArrayOutPutStream before processMessage

On processing byteArray with payload for flume, array byteArray increseases size of original file, with repeate bytes, and producing consequently repeat events. Solved buiding a ByteArrayOutPutStream and writin inside the buffer with parameter offset and bytesread, the ByteArrayOutPutStream to byteArray and this is processed.

CHUNKSIZE = 1024 ?

higher-bandwidth networks tend to use larger packets, although eight kilobytes is an effective maximum packet size for UDP on most networks today, and TCP segments are often no larger than a kilobyte.

SaveMap(sizeFileList): recovering state of events

para comprobar esta funcionalidad se ha generado un fichero sobre el que se anexan números incrementalmente, de modo que cada línea contiene un número, la anterior línea contiene el antecesor numérico y la siguiente contiene el predecesor, es decir:

linea#1 contiene el 1 línea#2 contiene el 2 línea#3 contiene el 3 ..................... línea#n contiene el n

Con la opción sink=file_roll se debe generar un archivo con todo el contenido del fichero, con la diferencia de que se debe mantener la integridad del contenido en su orden de procesado.

Dependencias externas:

commons-net-3.3.jar

/usr/local/src/apache-flume-1.4.0-bin/plugins.d/flume-ng-ftp/libext