Skip to content

Commit 74bff10

Browse files
author
Pradithya Aria
committed
Remove redis transaction
1 parent c471073 commit 74bff10

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

ingestion/src/main/java/feast/store/serving/redis/RedisCustomIO.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,16 @@ public static class WriteDoFn extends DoFn<RedisMutation, Void> {
138138
}
139139

140140
public WriteDoFn withBatchSize(int batchSize) {
141-
if (batchSize > 0) this.batchSize = batchSize;
141+
if (batchSize > 0) {
142+
this.batchSize = batchSize;
143+
}
142144
return this;
143145
}
144146

145147
public WriteDoFn withTimeout(int timeout) {
146-
if (timeout > 0) this.timeout = timeout;
148+
if (timeout > 0) {
149+
this.timeout = timeout;
150+
}
147151
return this;
148152
}
149153

@@ -155,7 +159,6 @@ public void setup() {
155159
@StartBundle
156160
public void startBundle() {
157161
pipeline = jedis.pipelined();
158-
pipeline.multi();
159162
batchCount = 0;
160163
}
161164

@@ -168,9 +171,7 @@ public void processElement(ProcessContext context) {
168171
}
169172
batchCount++;
170173
if (batchCount >= batchSize) {
171-
pipeline.exec();
172174
pipeline.sync();
173-
pipeline.multi();
174175
batchCount = 0;
175176
}
176177
}
@@ -197,10 +198,7 @@ private Response<?> writeRecord(RedisMutation mutation) {
197198

198199
@FinishBundle
199200
public void finishBundle() {
200-
if (pipeline.isInMulti()) {
201-
pipeline.exec();
202-
pipeline.sync();
203-
}
201+
pipeline.sync();
204202
batchCount = 0;
205203
}
206204

0 commit comments

Comments
 (0)