From f0ec51e413e0388bd37f8fe1e6223ded5fff6fda Mon Sep 17 00:00:00 2001 From: James McMullan Date: Wed, 1 Nov 2023 14:53:49 -0400 Subject: [PATCH] HPCC4J-551 HPCCFile Make TLK Use Optional - Added getter & setter for the useTLK option Signed-off-by: James McMullan James.McMullan@lexisnexis.com --- .../org/hpccsystems/dfs/client/HPCCFile.java | 28 +++++++++++++++++++ .../hpccsystems/dfs/client/DFSIndexTest.java | 7 ++--- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/dfsclient/src/main/java/org/hpccsystems/dfs/client/HPCCFile.java b/dfsclient/src/main/java/org/hpccsystems/dfs/client/HPCCFile.java index 0f745450e..8df2ba73e 100644 --- a/dfsclient/src/main/java/org/hpccsystems/dfs/client/HPCCFile.java +++ b/dfsclient/src/main/java/org/hpccsystems/dfs/client/HPCCFile.java @@ -318,6 +318,34 @@ public HPCCFile setClusterRemapInfo(RemapInfo remapinfo) return this; } + /** + * Get the value of useTLK option + * + * @return a boolean value indicating use of the TLK to filter index file reads + */ + public boolean getUseTLK() + { + return this.useTLK; + } + + /** + * Sets the useTLK option. + * Note: the value must be set before querying any data from the file, including record definition information. + * + * @param useTLK should the TLK be used to filter index file reads + * + * @return this HPCCFile + */ + public HPCCFile setUseTLK(boolean useTLK) + { + this.useTLK = useTLK; + + // Force the data parts to be re-created + this.dataParts = null; + + return this; + } + /** * Gets the filter. * diff --git a/dfsclient/src/test/java/org/hpccsystems/dfs/client/DFSIndexTest.java b/dfsclient/src/test/java/org/hpccsystems/dfs/client/DFSIndexTest.java index 74b92e4cb..1b95c5f11 100644 --- a/dfsclient/src/test/java/org/hpccsystems/dfs/client/DFSIndexTest.java +++ b/dfsclient/src/test/java/org/hpccsystems/dfs/client/DFSIndexTest.java @@ -230,11 +230,8 @@ public void tlkBypassTest() throws Exception // Read index ignoring TLK and check that all partitions are returned //------------------------------------------------------------------------------ - Connection espConn = new Connection(connString); - espConn.setUserName(hpccUser); - espConn.setPassword(hpccPass); - - HPCCFile file = new HPCCFile("~test::index::integer::key", espConn, "", "", new RemapInfo(), 0, "", false); + HPCCFile file = new HPCCFile("~test::index::integer::key", connString , hpccUser, hpccPass); + file.setUseTLK(false); DataPartition[] dataParts = file.getFileParts(); Long searchValue = 3L;