//package com.trs.digital.module.manager.service.digsearch;
//
//
//import com.trs.digital.framework.common.pojo.PageResult;
//import com.trs.digital.module.manager.configure.HybaseFactory;
//import com.trs.digital.module.manager.controller.admin.digftp.vo.DigFtpSourcePageReqVO;
//import com.trs.digital.module.manager.controller.admin.digsearch.vo.DigsearchPageReqVO;
//import com.trs.digital.module.manager.dal.dataobject.digftp.DigFtpSourceDO;
//import com.trs.digital.module.manager.dal.dataobject.digsearch.DigsearchDO;
//import com.trs.hybase.client.TRSConnection;
//import com.trs.hybase.client.TRSInputRecord;
//import com.trs.hybase.client.TRSResultSet;
//import com.trs.hybase.client.params.SearchParams;
//import com.trs.search.common.PagedList;
//import com.trs.search.common.StringHelper;
//import org.apache.commons.lang3.StringUtils;
//import org.apache.poi.ss.formula.functions.T;
//import org.springframework.stereotype.Service;
//
//import java.io.File;
//import java.util.List;
//import java.util.Map;
//
///**
// * 海贝
// */
//@Service
//public class HyBaseService {
//    public PageResult<DigsearchDO> getDigFtp1Page(DigsearchPageReqVO pageReqVO) {
//        TRSConnection connection = HybaseFactory.getClient();
//        PagedList<T> pagedList = null;
//        try {
//            long startPos = 0L;
//            SearchParams searchParmas = new SearchParams();
//            searchParmas.setSortMethod(StringHelper.avoidNull(""));
//            searchParmas.setReadColumns("doc_title;doc_content;doc_content_translate;file_name;file_path;file_type;file_crtime;file_updatetime;doc_lable;sourcename;language");
//            searchParmas.setColorColumns("doc_title;doc_content");
//            if(StringUtils.isNotBlank(filter)){
//                searchParmas.setProperty("search.range.filter", filter);
//            }
//            searchParmas.setCutSize(hybaseDocumentAnalysis.cutSize(entityClass.newInstance()));
//            TRSResultSet resultSet = null;
//            long from = pageSize < 0 ? startPos : startPos + pageNo * (long) pageSize;
//            long recordNum = pageSize < 0 ? 1024L : (long) pageSize;
//            long t1 = System.currentTimeMillis();
//            resultSet = connection.executeSelect("dig_ftp", trsl, pageReqVO.getPageNo(), pageReqVO.getPageSize(), searchParmas);
//            long t2 = System.currentTimeMillis();
//            //log.info(String.format("访问海贝库:[数据库:%s];[条件:%s];[类型:%s];[返回时间:%s毫秒]",
//            //        this.hybaseDocumentAnalysis.indexName(this.entityClass.newInstance()), trsl, "查询", t2 - t1));
//            long count = resultSet.getNumFound();
//            List<T> entities = FtsParser.parseResultSet(resultSet, entityClass);
//            pagedList = new PagedList(pageSize < 0 ? 0 : pageNo, pageSize < 0 ? 1024 : pageSize, (int) (count - Math.max(0L, startPos)), entities, 1);
//
//            return pagedList;
//        } catch (Exception e) {
//            log.warn("海贝查询异常:{}", e.getMessage());
//        } finally {
//            HybaseFactory.clean();
//        }
//        return new PagedList();
//    }
//
//
//}
