Commit 0a422942 authored by Jan Kotanski's avatar Jan Kotanski
Browse files

Update upstream source from tag 'upstream/buster/20.09.1'

Update to upstream version '20.09.1'
with Debian dir e04aec0d8f95ad6edd67ed92db632bba61057ea4
parents 3c1e9a15 c174f2fb
Metadata-Version: 1.0 Metadata-Version: 1.0
Name: asapo_producer Name: asapo_producer
Version: 20.09.0 Version: 20.09.1
Summary: UNKNOWN Summary: UNKNOWN
Home-page: UNKNOWN Home-page: UNKNOWN
Author: UNKNOWN Author: UNKNOWN
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -11,14 +11,21 @@ ...@@ -11,14 +11,21 @@
namespace asapo { namespace asapo {
class JsonStringParser;
uint64_t NanosecsEpochFromTimePoint(std::chrono::system_clock::time_point);
uint64_t EpochNanosecsFromNow();
std::chrono::system_clock::time_point TimePointfromNanosec(uint64_t nanoseconds_from_epoch);
std::string IsoDateFromEpochNanosecs(uint64_t time_from_epoch_nanosec); std::string IsoDateFromEpochNanosecs(uint64_t time_from_epoch_nanosec);
uint64_t NanosecsEpochFromISODate(std::string date_time); uint64_t NanosecsEpochFromISODate(std::string date_time);
uint64_t EpochNanosecsFromNow();
bool TimeFromJson(const JsonStringParser& parser, const std::string& name, std::chrono::system_clock::time_point* val);
class FileInfo { class FileInfo {
public: public:
std::string name; std::string name;
std::chrono::system_clock::time_point modify_date; std::chrono::system_clock::time_point timestamp;
uint64_t size{0}; uint64_t size{0};
uint64_t id{0}; uint64_t id{0};
std::string source; std::string source;
...@@ -29,16 +36,22 @@ class FileInfo { ...@@ -29,16 +36,22 @@ class FileInfo {
std::string FullName(const std::string& base_path) const; std::string FullName(const std::string& base_path) const;
}; };
struct StreamInfo { struct StreamInfo {
uint64_t last_id{0}; uint64_t last_id{0};
std::string Json() const; std::string name;
bool SetFromJson(const std::string& json_string); std::chrono::system_clock::time_point timestamp_created;
std::chrono::system_clock::time_point timestamp_lastentry;
std::string Json(bool add_last) const;
bool SetFromJson(const std::string& json_string,bool read_last);
}; };
using StreamInfos = std::vector<StreamInfo>;
inline bool operator==(const FileInfo& lhs, const FileInfo& rhs) { inline bool operator==(const FileInfo& lhs, const FileInfo& rhs) {
return (lhs.name == rhs.name && return (lhs.name == rhs.name &&
lhs.id == rhs.id && lhs.id == rhs.id &&
lhs.modify_date == rhs.modify_date && lhs.timestamp == rhs.timestamp &&
lhs.size == rhs.size); lhs.size == rhs.size);
} }
...@@ -53,7 +66,6 @@ struct DataSet { ...@@ -53,7 +66,6 @@ struct DataSet {
uint64_t id; uint64_t id;
FileInfos content; FileInfos content;
bool SetFromJson(const std::string& json_string); bool SetFromJson(const std::string& json_string);
}; };
using SubDirList = std::vector<std::string>; using SubDirList = std::vector<std::string>;
......
...@@ -23,6 +23,7 @@ enum Opcode : uint8_t { ...@@ -23,6 +23,7 @@ enum Opcode : uint8_t {
kOpcodeTransferData, kOpcodeTransferData,
kOpcodeTransferSubsetData, kOpcodeTransferSubsetData,
kOpcodeStreamInfo, kOpcodeStreamInfo,
kOpcodeLastStream,
kOpcodeGetBufferData, kOpcodeGetBufferData,
kOpcodeAuthorize, kOpcodeAuthorize,
kOpcodeTransferMetaData, kOpcodeTransferMetaData,
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
namespace asapo { namespace asapo {
const char kVersion[] = "20.09.0"; const char kVersion[] = "20.09.1";
inline void ExitAfterPrintVersionIfNeeded(std::string prefix,int argc, char* argv[]) { inline void ExitAfterPrintVersionIfNeeded(std::string prefix,int argc, char* argv[]) {
if (argc == 2 && strcmp(argv[1], "-v") == 0) { if (argc == 2 && strcmp(argv[1], "-v") == 0) {
......
...@@ -27,10 +27,19 @@ class Producer { ...@@ -27,10 +27,19 @@ class Producer {
//! Get substream information from receiver //! Get substream information from receiver
/*! /*!
\param substream (optional) - substream \param substream (optional) - substream
\param timeout_sec - operation timeout in seconds
\return StreamInfo - a structure with substream information \return StreamInfo - a structure with substream information
*/ */
virtual StreamInfo GetStreamInfo(std::string substream, uint64_t timeout_ms, Error* err) const = 0; virtual StreamInfo GetStreamInfo(std::string substream, uint64_t timeout_sec, Error* err) const = 0;
virtual StreamInfo GetStreamInfo(uint64_t timeout_ms, Error* err) const = 0; virtual StreamInfo GetStreamInfo(uint64_t timeout_sec, Error* err) const = 0;
//! Get substream that has the newest ingested data
/*!
\param timeout_ms - operation timeout in seconds
\return StreamInfo - a structure with substream information
*/
virtual StreamInfo GetLastSubstream(uint64_t timeout_sec, Error* err) const = 0;
//! Sends data to the receiver //! Sends data to the receiver
/*! /*!
......
No preview for this file type
...@@ -4,7 +4,7 @@ import numpy ...@@ -4,7 +4,7 @@ import numpy
ext_modules = [ ext_modules = [
Extension("asapo_producer", ["asapo_producer.cpp"], Extension("asapo_producer", ["asapo_producer.cpp"],
extra_objects=['lib/libasapo-producer.a', 'lib/libcurl.a'], extra_objects=[ 'lib/libasapo-producer.a', 'lib/libcurl.a'],
include_dirs=["include/common","include",numpy.get_include()], include_dirs=["include/common","include",numpy.get_include()],
extra_compile_args=['--std=c++11'], extra_compile_args=['--std=c++11'],
extra_link_args=['-static-libgcc','-static-libstdc++','-Wl,--exclude-libs,ALL'], extra_link_args=['-static-libgcc','-static-libstdc++','-Wl,--exclude-libs,ALL'],
...@@ -14,7 +14,7 @@ ext_modules = [ ...@@ -14,7 +14,7 @@ ext_modules = [
setup( setup(
name ="asapo_producer", name ="asapo_producer",
ext_modules = ext_modules, ext_modules = ext_modules,
version = "20.09.0", version = "20.09.1",
setup_requires=["numpy","cython>=0.28"], setup_requires=["numpy>=", "cython>=0.28"],
install_requires=["numpy","cython>=0.28"] install_requires=["numpy>="]
) )
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment