Skip to content

Commit

Permalink
TANDS-19093-transactionRegistry-interface (#1332)
Browse files Browse the repository at this point in the history
* TANDS-19093-transactionRegistry-interface

* TANDS-19093-transactionRegistry-interface

* TANDS-19093-transactionRegistry-interface

* TANDS-19093-fixing-bugs

* TANDS-19093-fixing-bugs

* TANDS-19093-fixing-bugs

* TANDS-19093-fixing-bugs

Co-authored-by: Ramsha Rao <[email protected]>
  • Loading branch information
ramshakr and Ramsha Rao authored May 19, 2020
1 parent 4deb5b2 commit 4460f0d
Showing 1 changed file with 48 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Copyright 2020, Yahoo Inc.
* Licensed under the Apache License, Version 2.0
* See LICENSE file in project root for terms.
*/
package com.yahoo.elide.core;

import lombok.Data;

import java.util.Set;
/**
* Transaction Registry interface to surface transaction details to other parts of Elide.
*/

public interface TransactionRegistry {
/**
* @see RequestScope
* @see DataStoreTransaction
*/
@Data
public static class TransactionEntry {
public RequestScope request;
public DataStoreTransaction transaction;
}

/**
* @return all running transactions
*/
Set<TransactionEntry> getRunningTransactions();

/**
* @param requestId
* @return matching running transaction
*/
Set<TransactionEntry> getRunningTransaction(String requestId);

/**
* Adds running transaction
* @param transactionEntry TransactionEntry transactionEntry
*/
void addRunningTransaction(TransactionEntry transactionEntry);

/**
* Removes running transaction when we call cancel on it
* @param transactionEntry TransactionEntry transactionEntry
*/
void removeRunningTransaction(TransactionEntry transactionEntry);
}

0 comments on commit 4460f0d

Please sign in to comment.