File indexing completed on 2025-08-28 08:26:53
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #pragma once
0019
0020 #include <string>
0021
0022 #include "arrow/acero/options.h"
0023 #include "arrow/acero/test_util_internal.h"
0024 #include "arrow/testing/random.h"
0025
0026 namespace arrow {
0027 namespace acero {
0028
0029
0030 AsyncGenerator<std::optional<ExecBatch>> MakeDelayedGen(
0031 Iterator<std::optional<ExecBatch>> src, std::string label, double delay_sec,
0032 bool noisy = false);
0033
0034
0035 AsyncGenerator<std::optional<ExecBatch>> MakeDelayedGen(
0036 AsyncGenerator<std::optional<ExecBatch>> src, std::string label, double delay_sec,
0037 bool noisy = false);
0038
0039
0040 AsyncGenerator<std::optional<ExecBatch>> MakeDelayedGen(BatchesWithSchema src,
0041 std::string label,
0042 double delay_sec,
0043 bool noisy = false);
0044
0045
0046 struct JitterNodeOptions : public ExecNodeOptions {
0047 random::SeedType seed;
0048
0049 int max_jitter_modifier;
0050
0051 explicit JitterNodeOptions(random::SeedType seed, int max_jitter_modifier = 5)
0052 : seed(seed), max_jitter_modifier(max_jitter_modifier) {}
0053 static constexpr std::string_view kName = "jitter";
0054 };
0055
0056 class GateImpl;
0057
0058 class Gate {
0059 public:
0060 static std::shared_ptr<Gate> Make();
0061
0062 Gate();
0063 virtual ~Gate();
0064
0065 void ReleaseAllBatches();
0066 void ReleaseOneBatch();
0067 Future<> WaitForNextReleasedBatch();
0068
0069 private:
0070 ARROW_DISALLOW_COPY_AND_ASSIGN(Gate);
0071
0072 GateImpl* impl_;
0073 };
0074
0075
0076 struct GatedNodeOptions : public ExecNodeOptions {
0077 explicit GatedNodeOptions(Gate* gate) : gate(gate) {}
0078 Gate* gate;
0079
0080 static constexpr std::string_view kName = "gated";
0081 };
0082
0083 void RegisterTestNodes();
0084
0085 }
0086 }