Uploaded image for project: 'Apache Tez'
  1. Apache Tez
  2. TEZ-4133

key class implements writableComparable and configurable use default configuration

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.10.0, 0.9.3
    • Component/s: None
    • Labels:
      None

      Description

      key class implments writableComparable and configurable ,setConf be invoked with a default configuration,it should  like mapreduce(org.apache.hadoop.mapred.JobConf#getOutputKeyComparator)

      //org.apache.tez.runtime.library.common.ConfigUtils#getIntermediateOutputKeyComparator
      public static <K> RawComparator<K> getIntermediateOutputKeyComparator(Configuration conf) {
        Class<? extends RawComparator> theClass = conf.getClass(
            TezRuntimeConfiguration.TEZ_RUNTIME_KEY_COMPARATOR_CLASS, null,
            RawComparator.class);
        if (theClass != null)
          return ReflectionUtils.newInstance(theClass, conf);
      // aybe change to 
      // return WritableComparator.get(getIntermediateOutputKeyClass(conf).asSubclass( //WritableComparable.class),conf);
        return WritableComparator.get(getIntermediateOutputKeyClass(conf).asSubclass(
            WritableComparable.class));
      }
      
      public static <K> RawComparator<K> getIntermediateInputKeyComparator(Configuration conf) {
        Class<? extends RawComparator> theClass = conf.getClass(
            TezRuntimeConfiguration.TEZ_RUNTIME_KEY_COMPARATOR_CLASS, null,
            RawComparator.class);
        if (theClass != null)
          return ReflectionUtils.newInstance(theClass, conf);
      // maybe change to 
      // return WritableComparator.get(getIntermediateInputKeyClass(conf).asSubclass( //WritableComparable.class),conf);
        return WritableComparator.get(getIntermediateInputKeyClass(conf).asSubclass(
            WritableComparable.class));
      }
      
      
      
       

       
       
       
       
       
       
       
       
       
       
       

        Attachments

        1. TEZ-4133-1.patch
          4 kB
          qiangwang
        2. TEZ-4133-2.patch
          4 kB
          qiangwang

          Issue Links

            Activity

              People

              • Assignee:
                backkom wang qiang
                Reporter:
                backkom wang qiang
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: