Package com.alimama.mdrill.solr.realtime

Examples of com.alimama.mdrill.solr.realtime.RealTimeDirectory


    PartionKey p = new PartionKey(corename, partion);

    boolean isWritePool = false;
    synchronized (forRealTimeDir) {

      RealTimeDirectory rtn = forRealTimeDir.remove(p);
      if (forwrite) {
        isWritePool = true;
        if (rtn == null) {
          rtn = forWriteDir.remove(p);
        }
      } else {
        if (rtn == null) {
          rtn = forWriteDir.remove(p);
          if (rtn != null) {
            isWritePool = true;
          }
        }
      }

      if (rtn == null) {

        File f = new File(getDataDir(), partion);
        try{
        rtn = new RealTimeDirectory(f, HadoopUtil.hadoopConfDir,
            ShardPartion
                .getHdfsRealtimePath(p.tablename, p.partion)
                .toString(),this,p);
        }catch(Throwable e)
        {
          log.error("getForWrite error",e);
          rtn=null;
        }
      }

      if (isWritePool) {
        forWriteDir.put(p, rtn);
      } else {
        forRealTimeDir.put(p, rtn);
      }
      rtn.setCore(this);
      rtn.setPartion(p);

      return rtn;
    }
  }
View Full Code Here

TOP

Related Classes of com.alimama.mdrill.solr.realtime.RealTimeDirectory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.