[ 
https://issues.apache.org/jira/browse/CASSANDRA-17048?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17431233#comment-17431233
 ] 

Benedict Elliott Smith edited comment on CASSANDRA-17048 at 10/20/21, 1:27 PM:
-------------------------------------------------------------------------------

Thanks. 

bq. we cannot use Base64

We can use a custom Base64 that is lexicographic in ASCII (or alternatively 
lexicographic in the alphabet by interleaving lowercase and upper case):

{code}
for (int i=0;i<64;i+=8) {
  int ch = (v & 0xff);
  if (ch < 2) ch = ch == 0 ? '+' : '-';
  else if ((ch - = 2) < 10) ch = '0' + ch;
  else if ((ch -= 10) < 26) ch = 'A' + ch;
  else ch = 'a' + (ch - 26);
  builder.append((char)ch);
  v >>>= 8;
}
{code}

Or whatever your preferred encoding is.

That is, assuming short path strings is our goal! It would require some work to 
validate the file system is case insensitive, that might not be worth it.


was (Author: benedict):
Thanks. 

bq. we cannot use Base64

We can use a custom Base64 that is lexicographic in ASCII (or alternatively 
lexicographic in the alphabet by interleaving lowercase and upper case):

{code}
for (int i=0;i<64;i+=8) {
  int ch = (v & 0xff);
  if (ch < 2) ch = ch == 0 ? '+' : '-';
  else if ((ch - = 2) < 10) ch = '0' + ch;
  else if ((ch -= 10) < 26) ch = 'A' + ch;
  else ch = 'a' + (ch - 26);
  builder.append((char)ch);
  v >>>= 8;
}
{code}

Or whatever your preferred encoding is.

> Replace sequential sstable generation identifier with ULID
> ----------------------------------------------------------
>
>                 Key: CASSANDRA-17048
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-17048
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Local/SSTable
>            Reporter: Jacek Lewandowski
>            Assignee: Jacek Lewandowski
>            Priority: Normal
>             Fix For: 4.1
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Replace the current sequential sstable generation identifier with ULID based.
> ULID is better because we do not need to scan the existing files to pick the 
> starting number as well as we can generate globally unique identifiers. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to