Java multithreading List data
Example 1:
Solution: how to let n threads traverse the List collection with n elements in sequence
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang3.ArrayUtils;
public class Test_4 {
/**
* Multithreading list
*
* @param data Data list
* @param threadNum Thread count
*/
public synchronized void ha ...
Added by edcellgavin on Thu, 05 Dec 2019 10:56:09 +0200
Java Serial 54-Two Singleton Modes, Interface Details
1. The singleton pattern is divided into two types:
(1) Hungry Han singleton: an object is created during the class loading stage.
(2) Lazy singleton: objects are created only when they are used.(Example in serials 53 is lazy)
Hungry Han Style Example:
package com.bjpowernode.java_learning;
public class D54_1_HungtySingtonMode {
publ ...
Added by ExpendableDecoy on Thu, 28 Nov 2019 18:44:09 +0200
oracle monitoring failure in windows
Phenomenon: the database service and monitoring run normally, but the function module is very slow to open;Process:I. check the database alert? Oaxx.log logLog switching is not high, no error is reported; database load is not large;II. Check database statusThe service and monitoring are running normally, sqlplus / as sysdba login is normal, an ...
Added by pppppp on Thu, 14 Nov 2019 17:42:04 +0200
Spark custom external data source
Background: sometimes we need to define an external data source and use spark sql to process it. There are two benefits:
(1) after defining the external data source, it is very simple to use, and the software architecture is clear. It can be used directly through sql.
(2) it is easy to divide modules into layers and build them up layer by lay ...
Added by kinaski on Tue, 12 Nov 2019 21:13:18 +0200
2. hbase -- integrate Phoenix to implement SQL like operation hbase
I. Phoenix overview
1, introductionPhoenix can be understood as the query engine of HBase, Phoenix, a project open-source by saleforce.com, and then donated to Apache. It is equivalent to a Java middleware to help developers, such as using jdbc to access relational databases, and accessing NoSql database HBase.
phoenix, the table and data of o ...
Added by zubinkasad on Tue, 05 Nov 2019 02:24:38 +0200
Shenzhen big data training: demonstration of Transformation operator
Shenzhen big data training: demonstration of Transformation operatorval conf = new SparkConf().setAppName("Test").setMaster("local")
val sc = new SparkContext(conf)
//Generation of rdd by parallelization
val rdd = sc.parallelize(List(5,6,4,7,3,8,2,9,10))
//map: multiply each element in rdd by 2 and sort
val rdd2: RDD[Int] = rdd.map(_ * 2 ...
Added by hippypink on Sat, 02 Nov 2019 22:04:15 +0200
Big data case: MapReduce's map end table merge (Distributedcache)
Code download address: https://github.com/tazhigang/big-data-github.git
I. preliminary preparation
Since this case is optimized on the basis of case 6, please refer to case 6 for requirements and data input and output; for the first time, you need to copy the pd.txt file in the root directory of the J disk of the local computer for reference.
...
Added by powerpants on Sat, 02 Nov 2019 05:21:35 +0200
What? You still don't use DataWorks scheduling?
Friends who have read interactive analysis of six pulse sword (portal: The initial experience of HoloStudio in interactive analysis of six pulse sword )It should be known that HoloStudio, a one-stop development platform based on interactive analysis engine, is deeply integrated into dataworks. With the support of dataworks's powerful function b ...
Added by r3drain on Thu, 31 Oct 2019 03:31:50 +0200
Cassandra cluster management - offline normal node
Test questions:
How to judge whether to use vnodes? Mainly look at your cassandra.yml configuration file.The default value (3.x) is blank, which is automatically generated by the system. If it is empty, it means that virtual nodes are used, which is enabled by default, and vnodes is used. After deleting a node, it will balance its own data, re ...
Added by TheOracle on Tue, 29 Oct 2019 22:19:57 +0200
Knotive practice: message push based on Kafka
Author: Yuanyi, senior development engineer of Alibaba cloud intelligent business group
Introduction: Currently, Kafka event sources are supported in knight. How to implement message push based on Kafka? The author of this article will take Alibaba cloud Kafka products as an example to unlock this new posture.
background
Message queuing for ...
Added by faraway on Fri, 25 Oct 2019 09:54:09 +0300