You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hawq.apache.org by shivzone <gi...@git.apache.org> on 2018/07/02 15:47:37 UTC
[GitHub] incubator-hawq pull request #1379: WIP: Cache UGI objects and clean them per...
Github user shivzone commented on a diff in the pull request:
https://github.com/apache/incubator-hawq/pull/1379#discussion_r199541316
--- Diff: pxf/pxf-service/src/main/java/org/apache/hawq/pxf/service/servlet/SecurityServletFilter.java ---
@@ -42,8 +52,51 @@
private static final Log LOG = LogFactory.getLog(SecurityServletFilter.class);
private static final String USER_HEADER = "X-GP-USER";
- private static final String MISSING_HEADER_ERROR = String.format("Header %s is missing in the request", USER_HEADER);
- private static final String EMPTY_HEADER_ERROR = String.format("Header %s is empty in the request", USER_HEADER);
+ private static final String SEGMENT_INDEX_HEADER = "X-GP-SEGMENT-ID";
+ private static final String TRANSACTION_ID_HEADER = "X-GP-XID";
+ private static final String MISSING_HEADER_ERROR = "Header %s is missing in the request";
+ private static final String EMPTY_HEADER_ERROR = "Header %s is empty in the request";
+ private static Map<SegmentTransactionId, TimedProxyUGI> cache = new ConcurrentHashMap<>();
--- End diff --
Why not use apache commons JCS or guava's caching library as opposed to implementing it ourselves with timer ?
---