@@ -70,7 +70,6 @@ public class FlinkExactlyOncePravegaWriter<T>
70
70
private final String streamName ;
71
71
72
72
private final long txnTimeoutMillis ;
73
- private final long txnMaxTimeMillis ;
74
73
private final long txnGracePeriodMillis ;
75
74
76
75
// ----------- runtime fields -----------
@@ -102,7 +101,7 @@ public FlinkExactlyOncePravegaWriter(
102
101
final PravegaEventRouter <T > router ) {
103
102
104
103
this (controllerURI , scope , streamName , serializationSchema , router ,
105
- DEFAULT_TXN_TIMEOUT_MILLIS , DEFAULT_TXN_TIMEOUT_MILLIS , DEFAULT_TX_SCALE_GRACE_MILLIS );
104
+ DEFAULT_TXN_TIMEOUT_MILLIS , DEFAULT_TX_SCALE_GRACE_MILLIS );
106
105
}
107
106
108
107
@@ -115,8 +114,6 @@ public FlinkExactlyOncePravegaWriter(
115
114
* @param serializationSchema The implementation for serializing every event into pravega's storage format.
116
115
* @param router The implementation to extract the partition key from the event.
117
116
* @param txnTimeoutMillis The number of milliseconds after which the transaction will be aborted.
118
- * @param txnMaxTimeMillis The maximum time (in milliseconds) to which transaction timeout may be
119
- * increased via the pingTransaction API.
120
117
* @param txnGracePeriodMillis The maximum amount of time, in milliseconds, until which transaction may
121
118
* remain active, after a scale operation has been initiated on the underlying stream.
122
119
*/
@@ -127,7 +124,6 @@ public FlinkExactlyOncePravegaWriter(
127
124
final SerializationSchema <T > serializationSchema ,
128
125
final PravegaEventRouter <T > router ,
129
126
final long txnTimeoutMillis ,
130
- final long txnMaxTimeMillis ,
131
127
final long txnGracePeriodMillis ) {
132
128
133
129
Preconditions .checkNotNull (controllerURI , "controllerURI" );
@@ -136,7 +132,6 @@ public FlinkExactlyOncePravegaWriter(
136
132
Preconditions .checkNotNull (serializationSchema , "serializationSchema" );
137
133
Preconditions .checkNotNull (router , "router" );
138
134
Preconditions .checkArgument (txnTimeoutMillis > 0 , "txnTimeoutMillis must be > 0" );
139
- Preconditions .checkArgument (txnMaxTimeMillis > 0 , "txnMaxTimeMillis must be > 0" );
140
135
Preconditions .checkArgument (txnGracePeriodMillis > 0 , "txnGracePeriodMillis must be > 0" );
141
136
142
137
this .controllerURI = controllerURI ;
@@ -146,7 +141,6 @@ public FlinkExactlyOncePravegaWriter(
146
141
this .eventRouter = router ;
147
142
148
143
this .txnTimeoutMillis = txnTimeoutMillis ;
149
- this .txnMaxTimeMillis = txnMaxTimeMillis ;
150
144
this .txnGracePeriodMillis = txnGracePeriodMillis ;
151
145
}
152
146
@@ -160,13 +154,13 @@ public void open(Configuration parameters) throws Exception {
160
154
this .pravegaWriter = clientFactory .createEventWriter (
161
155
this .streamName ,
162
156
serializer ,
163
- EventWriterConfig .builder ().build ());
157
+ EventWriterConfig .builder ().transactionTimeoutTime ( txnTimeoutMillis ). transactionTimeoutScaleGracePeriod ( txnGracePeriodMillis ). build ());
164
158
165
159
log .info ("Initialized pravega writer for stream: {}/{} with controller URI: {}" , this .scopeName ,
166
160
this .streamName , this .controllerURI );
167
161
168
162
// start the transaction that will hold the elements till the first checkpoint
169
- this .currentTxn = this .pravegaWriter .beginTxn (txnTimeoutMillis , txnMaxTimeMillis , txnGracePeriodMillis );
163
+ this .currentTxn = this .pravegaWriter .beginTxn ();
170
164
171
165
log .debug ("{} - started first transaction '{}'" , name (), this .currentTxn .getTxnId ());
172
166
@@ -227,7 +221,7 @@ public List<UUID> snapshotState(long checkpointId, long checkpointTime) throws E
227
221
this .txnsPendingCommit .addLast (new TransactionAndCheckpoint <>(txn , checkpointId ));
228
222
229
223
// start the next transaction for what comes after this checkpoint
230
- this .currentTxn = this .pravegaWriter .beginTxn (txnTimeoutMillis , txnMaxTimeMillis , txnGracePeriodMillis );
224
+ this .currentTxn = this .pravegaWriter .beginTxn ();
231
225
232
226
log .debug ("{} - started new transaction '{}'" , name (), this .currentTxn .getTxnId ());
233
227
log .debug ("{} - storing pending transactions {}" , name (), txnsPendingCommit );
0 commit comments