Skip to content

Commit e261b00

Browse files
author
Eric Harmeling
committed
Removed follower reads
1 parent e5ee92b commit e261b00

File tree

3 files changed

+0
-37
lines changed

3 files changed

+0
-37
lines changed

roach-data-jdbc/src/main/java/io/roach/data/jdbc/AccountController.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ public ResponseEntity<RepresentationModel> index() {
8484
*/
8585
@GetMapping("/account")
8686
@Transactional(propagation = REQUIRES_NEW)
87-
@TimeTravel // We dont need the result to be authoritative, so any follower replica can service the read
8887
public HttpEntity<PagedModel<AccountModel>> listAccounts(
8988
@PageableDefault(size = 5, direction = Sort.Direction.ASC) Pageable page) {
9089
return ResponseEntity

roach-data-jdbc/src/main/java/io/roach/data/jdbc/TimeTravel.java

Lines changed: 0 additions & 15 deletions
This file was deleted.

roach-data-jdbc/src/main/java/io/roach/data/jdbc/TransactionHintsAspect.java

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ public class TransactionHintsAspect {
3838
public void anyTransactionBoundaryOperation(Transactional transactional) {
3939
}
4040

41-
@Pointcut("execution(* io.roach..*(..)) && @annotation(followerRead)")
42-
public void anyFollowerReadOperation(TimeTravel followerRead) {
43-
}
44-
4541
@Around(value = "anyTransactionBoundaryOperation(transactional)",
4642
argNames = "pjp,transactional")
4743
public Object setTransactionAttributes(ProceedingJoinPoint pjp, Transactional transactional)
@@ -64,21 +60,4 @@ public Object setTransactionAttributes(ProceedingJoinPoint pjp, Transactional tr
6460

6561
return pjp.proceed();
6662
}
67-
68-
@Around(value = "anyFollowerReadOperation(timeTravel)",
69-
argNames = "pjp,timeTravel")
70-
public Object setTimeTravelAttributes(ProceedingJoinPoint pjp, TimeTravel timeTravel)
71-
throws Throwable {
72-
Assert.isTrue(TransactionSynchronizationManager.isActualTransactionActive(), "TX not active");
73-
74-
logger.info("Providing {} via follower read", pjp.getSignature().toShortString());
75-
76-
if (timeTravel.value() >= 0) {
77-
jdbcTemplate.update("SET TRANSACTION AS OF SYSTEM TIME INTERVAL '" + timeTravel.value() + "'");
78-
} else {
79-
jdbcTemplate.execute("SET TRANSACTION AS OF SYSTEM TIME experimental_follower_read_timestamp()");
80-
}
81-
82-
return pjp.proceed();
83-
}
8463
}

0 commit comments

Comments
 (0)