You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@distributedlog.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/05/20 02:37:04 UTC

[jira] [Commented] (DL-199) Be able to support filesystem-path like name

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

ASF GitHub Bot commented on DL-199:
-----------------------------------

Github user jiazhai commented on a diff in the pull request:

    https://github.com/apache/incubator-distributedlog/pull/130#discussion_r117600036
  
    --- Diff: distributedlog-core/src/main/java/org/apache/distributedlog/util/DLUtils.java ---
    @@ -281,41 +281,89 @@ public static boolean isReservedStreamName(String name) {
         }
     
         /**
    -     * Validate the stream name.
    +     * Validate the log name.
          *
    -     * @param nameOfStream
    -     *          name of stream
    +     * @param logName
    +     *          name of log
          * @throws InvalidStreamNameException
          */
    -    public static void validateName(String nameOfStream)
    +    public static String validateAndNormalizeName(String logName)
                 throws InvalidStreamNameException {
    -        String reason = null;
    -        char chars[] = nameOfStream.toCharArray();
    -        char c;
    -        // validate the stream to see if meet zookeeper path's requirement
    -        for (int i = 0; i < chars.length; i++) {
    -            c = chars[i];
    -
    -            if (c == 0) {
    -                reason = "null character not allowed @" + i;
    -                break;
    -            } else if (c == '/') {
    -                reason = "'/' not allowed @" + i;
    -                break;
    -            } else if (c > '\u0000' && c < '\u001f'
    -                    || c > '\u007f' && c < '\u009F'
    -                    || c > '\ud800' && c < '\uf8ff'
    -                    || c > '\ufff0' && c < '\uffff') {
    -                reason = "invalid charater @" + i;
    -                break;
    -            }
    +        if (isReservedStreamName(logName)) {
    +            throw new InvalidStreamNameException(logName, "Log Name is reserved");
             }
    -        if (null != reason) {
    -            throw new InvalidStreamNameException(nameOfStream, reason);
    +
    +        if (logName.charAt(0) == 47) {
    --- End diff --
    
    Is 47 intentional?  How about replace 47 with '/'  in this file? 


> Be able to support filesystem-path like name
> --------------------------------------------
>
>                 Key: DL-199
>                 URL: https://issues.apache.org/jira/browse/DL-199
>             Project: DistributedLog
>          Issue Type: Task
>          Components: distributedlog-core
>            Reporter: Sijie Guo
>            Assignee: Sijie Guo
>             Fix For: 0.5.0
>
>
> In order to support hierachical namespace, we need to be able to support filesystem path like log name.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)