Support Questions
Find answers, ask questions, and share your expertise

Hi..Is anything changed on TTL => 'FOREVER' on HDP 2.4?

Contributor
 
1 ACCEPTED SOLUTION

Guru

You can just omit the TTL parameter (meaning that do not specify) in which case it will default to FOREVER. I am not sure whether we used to parse TTL => 'FOREVER' as an expression before 2.4.

View solution in original post

12 REPLIES 12

Contributor

Because customer is asking TTL => 'FOREVER' worked for them in HDP 2.2 and its not working in HDP 2.4 while creating the Hbase tables, So they have to give CONFIGURATION => {'hbase.store.delete.expired.storefile' => 'false'} instead of TTL.

Super Collaborator

Can you ask for more detail from the customer ?

If a unit test which reproduces the situation can be obtained, that would be best.

I am going over changes to see if there may be any related JIRAs.

Contributor

We are trying to create the table in Hbase shell as below: Pasted the error.

ERROR: For input string: "FOREVER"

After this error we created table as below by removing TTL and adding hbase.store.delete.expired.storefile and it succeeded.

CONFIGURATION => {'hbase.store.delete.expired.storefile' => 'false'}}

Contributor

@Ted Yu Please see above

Super Collaborator

Please see related code in PrettyPrinter.java :

{code}

private static String humanReadableTTL(final long interval){

...

if (interval == Integer.MAX_VALUE) { sb.append("FOREVER");

{code}

Please specify Integer.MAX_VALUE for TTL and withdraw change to 'hbase.store.delete.expired.storefile'

Guru

You can just omit the TTL parameter (meaning that do not specify) in which case it will default to FOREVER. I am not sure whether we used to parse TTL => 'FOREVER' as an expression before 2.4.

Contributor

@Enis This worked. We just omitted TTL and created table. After that we did a Describe table and see TTL FOREVER. Thanks Enis

Super Collaborator

Turns out that the following JIRA is not in any HDP branch yet:

HBASE-13864 HColumnDescriptor should parse the output from master and from describe for TTL (Ashu Pachauri)

Before the above is backported, please use the workaround.

Contributor

Sure. Thanks @Ted Yu

Contributor

Accepting this answer as well!

Contributor

@Ted Yu

Same error Ted. Please see below:

ERROR: For input string: "MAX_VALUE"

Explorer

HConstants.FOREVER is now defined as follows:

  /**
   * Unlimited time-to-live.
   */
//  public static final int FOREVER = -1;
  public static final int FOREVER = Integer.MAX_VALUE;

So, you can specify 'FOREVER' for TTL by:

create 't1', {NAME => 'f1', TTL => 2147483647}

or

create 't1', {NAME => 'f1', TTL => 0x7fffffff}
Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.