distributedlog-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DL-199) Be able to support filesystem-path like name
Date Fri, 26 May 2017 21:08:04 GMT

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

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

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

    https://github.com/apache/incubator-distributedlog/pull/130#discussion_r118790138
  
    --- 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 --
    
    changed.


> 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)

Mime
View raw message