carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ManoharVanam <...@git.apache.org>
Subject [GitHub] incubator-carbondata pull request #492: [CARBONDATA-440] Providing the updat...
Date Fri, 06 Jan 2017 07:11:55 GMT
Github user ManoharVanam commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/492#discussion_r94907888
  
    --- Diff: core/src/main/java/org/apache/carbondata/core/carbon/path/CarbonTablePath.java
---
    @@ -316,57 +444,75 @@ public String getFactDir() {
         /**
          * gets updated timestamp information from given carbon data file name
          */
    -    public static String getUpdateTimeStamp(String carbonDataFileName) {
    -      // Get the file name from path
    +    public static String getTimeStampFromFileName(String carbonDataFileName) {
    +      // Get the timestamp portion of the file.
           String fileName = getFileName(carbonDataFileName);
    -      // + 1 for size of "-"
    -      int firstDashPos = fileName.indexOf("-");
    -      int secondDashPos = fileName.indexOf("-", firstDashPos + 1);
    -      int startIndex = fileName.indexOf("-", secondDashPos + 1) + 1;
    -      int endIndex = fileName.indexOf(".");
    +      int startIndex = fileName.lastIndexOf(CarbonCommonConstants.HYPHEN) + 1;
    +      int endIndex = fileName.indexOf(".", startIndex);
           return fileName.substring(startIndex, endIndex);
         }
     
    +
         /**
    -     * gets file part number information from given carbon data file name
    +     * This will return the timestamp present in the delete delta file.
    +     * @param fileName
    +     * @return
          */
    -    public static String getPartNo(String carbonDataFileName) {
    +    public static String getTimeStampFromDeleteDeltaFile(String fileName) {
    +      return fileName.substring(fileName.lastIndexOf(CarbonCommonConstants.HYPHEN) +
1,
    +          fileName.lastIndexOf("."));
    +    }
    +
    +    /**
    +     * This will return the timestamp present in the delete delta file.
    +     * @param fileName
    +     * @return
    +     */
    +    public static String getBlockNameFromDeleteDeltaFile(String fileName) {
    +      return fileName.substring(0,
    +          fileName.lastIndexOf(CarbonCommonConstants.HYPHEN));
    +    }
    +
    +    /**
    +     * gets updated timestamp information from given carbon data file name
    +     */
    +    public static String getBucketNo(String carbonFilePath) {
           // Get the file name from path
    -      String fileName = getFileName(carbonDataFileName);
    +      String fileName = getFileName(carbonFilePath);
           // + 1 for size of "-"
    -      int startIndex = fileName.indexOf("-") + 1;
    +      int firstDashPos = fileName.indexOf("-");
    --- End diff --
    
    use CarbonCommonConstants.HYPHEN



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message