This file contains 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
/** | |
* create by imad.x | |
* email:100650920@qq.com | |
*/ | |
var app = angular.module('plunker', []); | |
function createDirective() { | |
return function () { | |
return { | |
restrict: 'A', | |
compile: function (tElem, tAttrs) { |
This file contains 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
/* Example using MultipleOutputs to write a Spark RDD to multiples files. | |
Based on saveAsNewAPIHadoopFile implemented in org.apache.spark.rdd.PairRDDFunctions, org.apache.hadoop.mapreduce.SparkHadoopMapReduceUtil. | |
val values = sc.parallelize(List( | |
("fruit/items", "apple"), | |
("vegetable/items", "broccoli"), | |
("fruit/items", "pear"), | |
("fruit/items", "peach"), | |
("vegetable/items", "celery"), | |
("vegetable/items", "spinach") |
This file contains 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
def moveFile(day: String, fileSystem: FileSystem): Unit = { | |
val status: Array[FileStatus] = fileSystem.listStatus(new Path(TableConstents.TEMP_TRANSFER_TABLE_PATH + day)) | |
status.foreach { | |
s => | |
if (s.isDirectory) { | |
fileSystem.listStatus(s.getPath).foreach { | |
p => | |
val path: String = p.getPath.toString | |
//1.replace path | |
val newPath = path.replace("/temp/" + day, "") |
This file contains 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
object common extends App { | |
val a = "s" | |
println(s"wo kao $a") | |
case class Foo(val name: String, val age: Int, val sex: Symbol) | |
val fooList = Foo("Hugh Jass", 25, 'male) :: | |
Foo("Biggus Dickus", 43, 'male) :: | |
Foo("Incontinentia Buttocks", 37, 'female) :: | |
Nil |
This file contains 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
private static enum SingletonHolder { | |
INSTANCE; | |
Object lock = new Object(); | |
SpanReceiverHost host = null; | |
} |
This file contains 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 |
This file contains 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 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 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 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); | |
}); |
OlderNewer