This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding=utf-8 | |
import logging | |
import traceback | |
import jieba | |
import jieba.analyse | |
import redis | |
import sys | |
import os | |
import json | |
import codecs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.pajk.bigdata.flink.utils; | |
import org.apache.hadoop.hbase.util.Bytes; | |
import org.testng.annotations.Test; | |
import org.testng.collections.Lists; | |
import java.io.IOException; | |
import java.nio.file.Files; | |
import java.nio.file.Paths; | |
import java.util.List; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2002-2012 the original author or authors. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CronTrigger cronTrigger = new CronTrigger("* 0/2 * * * * "); | |
SimpleTriggerContext triggerContext = new SimpleTriggerContext(); | |
triggerContext.update(new Date(System.currentTimeMillis()),new Date(System.currentTimeMillis()+10), | |
new Date(System.currentTimeMillis()+100)); | |
Date date = cronTrigger.nextExecutionTime(triggerContext); | |
System.out.println(date); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.scheduling.TaskScheduler; | |
import org.springframework.scheduling.annotation.SchedulingConfigurer; | |
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; | |
import org.springframework.scheduling.config.ScheduledTaskRegistrar; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$rootScope.$watch('tmpChartCount', function (newValue, oldValue, isRefren) { | |
console.log("change"); | |
if ($rootScope.tmpChartMap.count() > 0) | |
$rootScope.tmpChartMap.forEach(function (k, v) { | |
$http.get(v.url).then(function (response) { | |
v.data = response.data; | |
v.draw(); | |
$rootScope.chartMap.set(k, v); | |
$rootScope.tmpChartMap.remove(k); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collections.<KeyValueScanner> singletonList(new MemStoreScanner(readPt)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CompletionService<HStore> completionService = | |
new ExecutorCompletionService<HStore>(storeOpenerThreadPool); | |
// initialize each store in parallel | |
for (final HColumnDescriptor family : htableDescriptor.getFamilies()) { | |
status.setStatus("Instantiating store for column family " + family); | |
completionService.submit(new Callable<HStore>() { | |
@Override | |
public HStore call() throws IOException { | |
return instantiateHStore(family); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ExecutorCompletionService<V> implements CompletionService<V> { | |
private final Executor executor; | |
private final AbstractExecutorService aes; | |
private final BlockingQueue<Future<V>> completionQueue; | |
/** | |
* FutureTask extension to enqueue upon completion | |
*/ | |
private class QueueingFuture extends FutureTask<Void> { | |
QueueingFuture(RunnableFuture<V> task) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Licensed to the Apache Software Foundation (ASF) under one | |
* or more contributor license agreements. See the NOTICE file | |
* distributed with this work for additional information | |
* regarding copyright ownership. The ASF licenses this file | |
* to you under the Apache License, Version 2.0 (the | |
* "License"); you may not use this file except in compliance | |
* with the License. You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 |
NewerOlder