msharee9 commented on a change in pull request #604: MINIFICPP-926 Create nanofi tailfile processor for tailing file by configurable chunk size URL: https://github.com/apache/nifi-minifi-cpp/pull/604#discussion_r303192759
########## File path: nanofi/include/core/file_utils.h ########## @@ -0,0 +1,83 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef NANOFI_INCLUDE_CORE_FILE_UTILS_H_ +#define NANOFI_INCLUDE_CORE_FILE_UTILS_H_ + +#include "utlist.h" +#include "flowfiles.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Tails a delimited file starting from an offset up to the end of file + * @param file the path to the file to tail + * @param delim the delimiter character + * @param curr_offset the offset in the file to tail from. + * For eg. To tail from beginning of the file curr_offset = 0 + * @param instance the nifi_instance + * @param proc the standalone_processor + * @return a list of flow file info containing list of flow file records + * and the current offset in the file + */ +flow_file_info log_aggregate(const char * file_path, char delim, uint64_t curr_offset, nifi_instance * instance, standalone_processor * proc); Review comment: Segregated this out of this file. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
