删除注释代码
This commit is contained in:
@@ -49,18 +49,16 @@ public class SingleHttpSource extends RichHttpSourceFunction<Map<String, byte[]>
|
||||
|
||||
private static Header header;
|
||||
|
||||
// private static JsonMapper jsonMapperInstance = JsonMapper.getInstance();
|
||||
// private static JavaType listType = jsonMapperInstance.createCollectionType(List.class, KnowledgeLog.class);
|
||||
private static final String EXPR = "$.[?(@.version=='latest' && @.name in ['ip_v4_built_in','ip_v6_built_in','ip_v4_user_defined','ip_v6_user_defined'])].['name','sha256','format','path']";
|
||||
|
||||
|
||||
// private static Map<String, String> updateMap = new HashMap<>();
|
||||
|
||||
private static Map<String, String> knowledgeMetaCache = new HashMap<>();
|
||||
|
||||
private static HashMap<String, byte[]> knowledgeFileCache;
|
||||
private boolean isRunning = true;
|
||||
//是否下发,默认不发送
|
||||
private boolean isSending = false;
|
||||
|
||||
private static final int TRY_TIMES = 3;
|
||||
|
||||
|
||||
@@ -192,7 +190,7 @@ public class SingleHttpSource extends RichHttpSourceFunction<Map<String, byte[]>
|
||||
if (downloadBytes.length>0){
|
||||
String downloadFileSha256Hex = DigestUtil.sha256Hex(downloadBytes);
|
||||
if (sha256.equals(downloadFileSha256Hex)){
|
||||
logger.info("通过HOS下载{}的sha256为:{} ,Nacos内记录为:{} ,sha256相等", fileName, downloadFileSha256Hex, sha256);
|
||||
logger.info("通过HOS下载{}的sha256为:{} ,Nacos内记录为:{} ,sha256相等", fileName, sha256);
|
||||
knowledgeMetaCache.put(fileName, sha256);
|
||||
knowledgeFileCache.put(fileName, downloadBytes);
|
||||
updateLocalFile(fileName);
|
||||
@@ -224,10 +222,6 @@ public class SingleHttpSource extends RichHttpSourceFunction<Map<String, byte[]>
|
||||
File file = new File(CommonConfig.DOWNLOAD_PATH.concat(File.separator).concat(fileName));
|
||||
outputStream = new FileOutputStream(file);
|
||||
IoUtil.copy(new ByteArrayInputStream(knowledgeFileCache.get(fileName)), outputStream);
|
||||
// byte[] bytes = IOUtils.toByteArray(inputStream);
|
||||
// knowledgeFileCache.put(fileName, bytes);
|
||||
// inputStream=new ByteArrayInputStream(bytes);
|
||||
// IoUtil.copy(inputStream, outputStream);
|
||||
} catch (IOException ioe) {
|
||||
logger.error("更新本地文件{}时发生IO异常,异常信息为:", fileName, ioe.getMessage());
|
||||
ioe.printStackTrace();
|
||||
|
||||
Reference in New Issue
Block a user