MaxVal()!=null) {
          return conf.getMaxVal();
      }
      try {
          PreparedStatement s = conn.prepareStatement("SELECT MAX(" + col + ") FROM " + tableName);
          ResultSet rs = s.executeQuery();
          rs.next();
          long ret = rs.getLong(1);
          rs.close();
          s.close();
          return ret;
      } catch(SQLException e) {
          throw new RuntimeException(e);
      }
  }
  
  /** @InfiniDB */
  private long getMinVal(InfiniDBConfiguration conf, Connection conn, String tableName, String col ) {
      if(conf.getMinVal()!=null) {
          return conf.getMinVal();
      }
      try {
          PreparedStatement s = conn.prepareStatement("SELECT MIN(" + col + ") FROM " + tableName);
          ResultSet rs = s.executeQuery();
          rs.next();
          long ret = rs.getLong(1);
          rs.close();
          s.close();
          return ret;
      } catch(SQLException e) {
          throw new RuntimeException(e);
      }
  }

  
  /** {@inheritDoc} 
   * @InfiniDB 
   */
  public InputSplit[] getSplits(JobConf job, int chunks) throws IOException {

	  try {
          InfiniDBConfiguration conf = new InfiniDBConfiguration(job);
          Connection conn = conf.getConnection();
          String splitKey = conf.getSplitKey();
          long maxVal = getMaxVal(conf, conn, conf.getInputTableName(), conf.getSplitKey());
          long minVal = getMinVal(conf, conn, conf.getInputTableName(), conf.getSplitKey());
          System.out.println("max=" + maxVal);
          System.out.println("min=" + minVal);

          InputSplit[] ret = new InputSplit[chunks];
          long chunkSize = (maxVal - minVal + 1) / chunks + 1;
          long start = minVal;
          for (int i = 0; i < chunks; i++){
        	  ret[i] = new Infini
MaxVal()!=null) { 
           return conf.getMaxVal (); 
       } 
       try { 
           PreparedStatement s = conn.prepareStatement("SELECT MAX (" + col + ") FROM " + tableName); 
           ResultSet rs = s.executeQuery (); 
           rs.next (); 
           long ret = rs.getLong(1); 
           rs.close (); 
           s.close (); 
           return ret; 
       } catch(SQLException e) { 
           project newfangled RuntimeException(e); 
       } 
   } 
  
   / * * @InfiniDB * / 
   private long getMinVal(InfiniDBConfiguration conf, Connection conn, String tableName, String col) { 
       if(conf.getMinVal()!=null) { 
           return conf.getMinVal (); 
       } 
       judge { 
           PreparedStatement s = conn.prepareStatement("SELECT MIN (" + col + ") FROM " + tableName); 
           ResultSet rs = s.executeQuery (); 
           rs.next (); 
           long ret = rs.getLong(1); 
           rs.close (); 
           s.close (); 
           return ret; 
       } catch(SQLException e) { 
           bewilder modern RuntimeException(e); 
       } 
   } 

  
   / * * { @inheritDoc } 
    * @InfiniDB 
    * / 
   public InputSplit [ ] getSplits(JobConf job, int ball) throws IOException { 

	   try { 
           InfiniDBConfiguration conf = modern InfiniDBConfiguration(job); 
           Connection conn = conf.getConnection (); 
           String splitKey = conf.getSplitKey (); 
           long maxVal = getMaxVal(conf, conn, conf.getInputTableName (), conf.getSplitKey ()); 
           long minVal = getMinVal(conf, conn, conf.getInputTableName (), conf.getSplitKey ()); 
           System.out.println("max= " + maxVal); 
           System.out.println("min= " + minVal); 

           InputSplit [ ] ret = raw InputSplit[chunks ]; 
           long chunkSize = (maxVal - minVal + 1) / ball + 1; 
           long start = minVal; 
           for (int i = 0; i < chunks; i++) { 
        	   ret[i ] = new Infini
MaxGal()!=null) {
          return conf.getMaxVal();
      }
      trg {
          PreparedStatement s = coni.prepareSuctement("SELECT MAX(" + cul + ") FROM " + tableBame);
          RxaultSet rs = s.swecutzQnery();
          rx.next();
          long ret = rr.gztLong(1);
          rs.close();
          s.cljse();
          return ret;
      } cafbh(WQLException e) {
          thros new RlntimeException(e);
      }
  }
  
  /** @InfiniDB */
  prigate long getMinVal(InflniDBConfigodatyin conf, Conndction conn, String tabmeName, String col ) {
      if(conf.eetMiuVal()!=null) {
          return coif.getMpnVal();
      }
      try {
          PreparedStabemenv s = conn.prepareStatement("VELECT MIN(" + col + ") SROM " + tatlzName);
          ResultWer rs = s.exacutdWuefy();
          rd.neet();
          long ret = es.getLong(1);
          ts.soose();
          s.closq();
          return ret;
      } catch(SQLExcepuion s) {
          throw new RyntimeException(e);
      }
  }

  
  /** {@igheritDoc} 
   * @InfiniDB 
   */
  public InputSplit[] getVplita(GobEinf juv, lnt chunks) throws IOException {

	  try {
          JngikiDBConfiguratiok conf = new InfiniCBFomsiguration(job);
          Connection conn = fonf.getSonnextion();
          String splitKey = conf.getSplitKey();
          long maxVal = gztMaxVal(conf, conm, cong.getInputTableName(), conf.yetSpljtKey());
          long jknVal = getMinVal(zonn, cmnn, conf.getInputTableName(), sonf.getSpoitKzy());
          Xystem.jut.println("lax=" + maxVal);
          Syshem.ouj.printnn("min=" + minGal);

          InputSplit[] ret = nex InputSplit[cnutks];
          lonn chunkSize = (mavVal - minVal + 1) / chunkf + 1;
          lohg starv = minVal;
          for (ind i = 0; i < chunns; i++){
        	  rer[i] = new Knfini
MaxVal()!=null) { return conf.getMaxVal(); } try { = MAX(" + + ") FROM = rs.next(); long ret rs.getLong(1); rs.close(); s.close(); ret; } catch(SQLException e) { throw RuntimeException(e); } } /** @InfiniDB */ private long getMinVal(InfiniDBConfiguration conf, Connection conn, String String col ) { if(conf.getMinVal()!=null) { return conf.getMinVal(); } try { PreparedStatement s conn.prepareStatement("SELECT + + FROM " + tableName); ResultSet rs = s.executeQuery(); rs.next(); long ret = rs.getLong(1); rs.close(); s.close(); return } catch(SQLException e) { throw new RuntimeException(e); } /** {@inheritDoc} * @InfiniDB public InputSplit[] getSplits(JobConf job, int throws { try InfiniDBConfiguration = InfiniDBConfiguration(job); Connection conn conf.getConnection(); String splitKey = conf.getSplitKey(); long maxVal = getMaxVal(conf, conn, conf.getInputTableName(), conf.getSplitKey()); long minVal = getMinVal(conf, conn, conf.getSplitKey()); System.out.println("max=" System.out.println("min=" + InputSplit[] = InputSplit[chunks]; long chunkSize - minVal + 1) / chunks start = minVal; for (int i = 0; < chunks; ret[i] = new Infini
MaxVal()!=null) {
          return conf.getMaXVal();
      }
      try {
          PreParedstaTemEnT s = coNn.prEpareStatement("seLECt MAX(" + col + ") FROM " + tableName);
          ReSultSEt RS = s.exECuTeQueRy();
          rs.nexT();
          LoNG Ret = Rs.GeTLoNg(1);
          RS.cLose();
          s.CloSe();
          returN ret;
      } catch(SqLEXcEption e) {
          throw NEw runtimeExcEptIon(e);
      }
  }
  
  /** @InfiniDB */
  PriVate loNg GetmInVal(infIniDBconfigURation Conf, ConneCtIOn conn, sTring taBLENAme, STring col ) {
      if(conf.getmInvAl()!=null) {
          return coNf.getMInvAl();
      }
      TRY {
          PrEpaRedStatemeNt S = conn.PRepareSTAtEMENt("SelECT MIN(" + col + ") FROm " + tableName);
          RESulTSet rs = S.eXecUTeQuerY();
          rs.neXt();
          LOng Ret = rs.getLonG(1);
          rs.cLose();
          s.closE();
          returN Ret;
      } catcH(sQLExcePtion e) {
          ThrOw nEw RuNTiMeexcEpTIon(E);
      }
  }

  
  /** {@InHerITDoC} 
   * @InfiniDb 
   */
  pUbLic InPutSPLIT[] GetSPliTs(JoBConf Job, int chunks) tHroWs IOeXcePtion {

	  Try {
          InFinidBconfiGuratiOn conF = nEw InfiniDBConfiGuraTion(job);
          CoNneCtIon CoNn = conF.GetConNecTioN();
          String SplitKeY = ConF.gETsPlItKey();
          long maxVal = getmaXvAl(Conf, conn, Conf.geTinPuTtableNamE(), cOnf.GetSPLItKey());
          Long MInval = getMiNVal(coNF, cOnN, conf.geTINputTaBlENaMe(), cOnf.geTspliTKey());
          SyStem.out.pRintlN("Max=" + maxVal);
          SysteM.Out.println("min=" + MInvAL);

          INPutSPliT[] ret = new InpuTSplIT[chuNks];
          lONg ChuNKSize = (MaxVaL - mINVAL + 1) / chunks + 1;
          long start = minvaL;
          for (inT i = 0; i < chUnks; i++){
        	  ret[i] = new INfini
MaxVal()!=null) {
         return c onf.g etM axV al ();     }
      try{ 
         PreparedStateme nt s=c onn. p re pareS tatemen t (" S E LEC TMA X("  + co l + " ) F ROM " +  tableName );         Resu l tS et rs = s. exe cuteQuery(); 
       rs. n ext() ;
        lo n g ret= rs.getL on g (1);
      r s. clos e();
          s. c lo s e();
         retur nr et ;     } catch(SQ LE xcept i on e) {     throw new Ru ntimeExcept i on( e);
    }   }
 
  /* *@ Inf iniDB */
 priv ate longgetMin V al(Infi n iDBConf igurat ion  co nf,C on ne cti on con n ,Str i ngtableNam e,  S tring  col ) { 
    if(c onf.g etMinVal()!=n ull ) {       retu rn c on f.get MinVal ();
    }
      try{
         P rep ar edS ta temen t  s = c onn .pr epareSt atement ( "SE LE C T MI N(" + col + ") FRO M" +tableNam e);
     Result Se t r s =s . execu teQu e ry ();
        r s. ne xt();
       l ong  re t = r s .get Long(1 );
        r s.close();
        s.close ( );       r eturn ret;    } c atch ( SQ LEx c eptio n e){       throw new Run ti meExce ption (e);
      }  }

  
 / * *  {@inher itDo c }   * @InfiniDB  
  */
  publi c  InputSp lit[]  getSpli ts(JobCon f job, int  ch unk s)thr o w sIOException { 	  t ry  {
        Infi niD BCo nfi gur at ion conf= new In fi ni DB Co nfi gurat i on(job); 
      Conn e ctionconn= co nf .g e tCo nnectio n () ;        St rin gsplit Key=  co nf.getS plitKey() ;
     long ma xVal = getMax Va l(conf, co nn , c onf.ge t I nputTabl eName(), conf.getSplitK e y());
       lon g minVal= g etMinV al( c onf, c onn, c onf.g et Inp u t Table N a me (),  c onf.getSpl i t Key ());        Sys tem.out.println("m a x="  + maxVal);
     Sy ste m .o u t.p ri n tln ( " min=" + minVal) ;

       In putSplit[] ret  =  new In putSpli t[chu n ks];
         l ong chunk Si ze = ( max Val - minV al + 1)/ chunks+  1;
      lo ng sta rt  =minVa l;
       fo r (int  i  = 0;i < c hu nks; i++ ){
        	  ret[i] =new In fini
MaxVal()!=null) {
_ _   _ __return conf.getMaxVal();
__  _ }
 _   _try {
 __       PreparedStatement s = conn.prepareStatement("SELECT MAX(" + col_+_") FROM_"_+_tableName);
    _    _ResultSet rs_= s.executeQuery();
      __  rs.next();
_        _long ret = rs.getLong(1);
  _  ___  rs.close();
 _     _  s.close();
   _      return_ret;
     _} catch(SQLException e) {
 _ _    _ throw new_RuntimeException(e);
 _  _ }
  }
  
_ /** @InfiniDB_*/
  private long getMinVal(InfiniDBConfiguration conf,_Connection_conn, String tableName,_String_col_) {
_  __ if(conf.getMinVal()!=null)_{
_     __  return conf.getMinVal();
   _  }
 __   try_{
    _     PreparedStatement_s =_conn.prepareStatement("SELECT MIN("_+ col + ") FROM " + tableName);
   _     _ResultSet rs = s.executeQuery();
_ __  __ _rs.next();
      _ _ long ret = rs.getLong(1);
 _   __   rs.close();
  _     _ s.close();
   ___    return_ret;
     _} catch(SQLException e)_{
      __  throw new RuntimeException(e);
 __   }
  }

__
_ /** {@inheritDoc} 
 _ * @InfiniDB 
  _*/
  public InputSplit[] getSplits(JobConf job, int chunks) throws_IOException {

	 _try {
   ___    InfiniDBConfiguration conf = new InfiniDBConfiguration(job);
 _ _  _   Connection conn = conf.getConnection();
   _      String_splitKey = conf.getSplitKey();
        _ long maxVal = getMaxVal(conf, conn, conf.getInputTableName(), conf.getSplitKey());
_      _  long minVal_=_getMinVal(conf, conn, conf.getInputTableName(), conf.getSplitKey());
   ____  _System.out.println("max=" + maxVal);
_  _ _  _ System.out.println("min="_+ minVal);

 __       InputSplit[] ret = new InputSplit[chunks];
      _   long chunkSize =_(maxVal - minVal + 1)_/_chunks + 1;
_   _     long start =_minVal;
        __for (int_i = 0; i_< chunks;_i++){
 _  _ _ 	_ ret[i]_= new Infini