Skip to content

Commit

Permalink
HPCC4J-551 HPCCFile Make TLK Use Optional
Browse files Browse the repository at this point in the history
- Added getter & setter for the useTLK option

Signed-off-by: James McMullan [email protected]
  • Loading branch information
jpmcmu committed Nov 1, 2023
1 parent 2dc8279 commit f0ec51e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 5 deletions.
28 changes: 28 additions & 0 deletions dfsclient/src/main/java/org/hpccsystems/dfs/client/HPCCFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f0ec51e

Please sign in to comment.