hadoop fs -mkdir Create HDFS directory
Hadoop fs -ls List HDFS directory
hadoop fs -copyFromLocal Copy local files to HDFS
hadoop fs -put Using put to copy files to HDFS, if files already exist, they will be directly covered.
hadoop fs -cat List file contents in HDFS directory
hadoop fs -copyToLocal Copy files on HDFS to local
hadoop fs -get Use get to copy files on HDFS to local
hadoop fs -cp Copy HDFS file
hadoop fs -rm Delete HDFS file
hadoop fs -rm -R Delete HDFS directory
Enter the master boot command:
start-all.sh
Write on Dao implementation layer or manager level.
default List<BbwBarrage> findByEnable(int enable) {
return this.findAll(new Specification<BbwBarrage>() {@Overridepublic Predicate toPredicate(Root<BbwBarrage> root, CriteriaQuery<?> query, CriteriaBuilder criteriaBuilder) {Predicate predicate;// TODO Auto-generated method stubPath enableP = root.get(“enable”);
predicate = criteriaBuilder.equal(enableP, enable);
query.where(predicate);
return predicate;}});}
Directly in the controller layer
List<T> lists = xxManager.finaAll(xx);
Paging query...
Start MySQL instance error report, view error log
## error message2018-08-31T10:38:36.945081Z 0 [ERROR] InnoDB: The Auto-extending innodb_system data file ‘./ibdata1’ is of a different size 768 pages (rounded down to MB) than specified in the .cnf file: initial 1536 pages, max 0 (relevant if non-zero) pages!
Settlement process:
768/64=12
View the my.cnf file willinnodb_data_file_path = ibdata1:24M:autoextend
Change to
innodb_data_file_path = ibdata1:12M:autoextend
Start again!
1 #include<iostream>
2 #include<cstdio>
3 #include<cstring>
4 using namespace std;
5 const int maxn=2e5+7;
6 const int maxc=57;
7 int n,k,p,ret=0;
8 int col[maxn],f[maxn],cst[maxn],minn[maxc],before[maxc],sum[maxc],ans[maxc];
9 int main(){
10 memset(minn,2147483647,sizeof(minn));
11 cin>>n>>k>>p;
12 for(int i=1;i<=n;i++) cin>>col[i]>>cst[i];
13 for(int i=1;i<=n;i++){
14 for(int j=0;j<k;j++)
15 minn[j]=min(minn[j],cst[i]);
16 if(minn[col[i]]<=p){
17 f[i]=sum[col[i]];
18...
Because it is difficult to query every time you connect to the database, you occasionally need to convert the query results to a JSON file.
So temporarily define a MySQL class that encapsulates these commonly used methods for direct invocation (code is as follows, for personal use, without any comments).
Note: the package of https://github.com/stleary/JSON-java is imported.
1 package connmysql;
2
3 import java.io.IOException;
4 import java.io.InputStream;
5 import java.sql.Connection;
6 import java.sql.DriverManager;
7 import java.sql.PreparedStatement;
8 import java.sql.Res...
ACID(Atomicity Atomicity, Consistency consistency, Isolation isolation, Durability persistence) are a series of attributes.
These attributes ensure the reliability of database objects. In a database, a series of operations on data can be logically viewed as a whole operation, which is called things.
Atomicity” (atomicity)
Atomicity requires that all operations in each thing be either complete or as if none of them happened: if some of the operations in the thing fail, the whole thing fails, and the result is that the state in the database remains unchanged. Atomicity systems must ensu...
udevadm Then a command and command specify the options. It controls the behavior of udev, handles kernel events, controls event queues, and provides a simple debugging mechanism.
Options:
–debug Print error message
–version Print version information
–help Help document
udevadm info options Query the device information in the udev database. You can also query the properties of the device from the sysfs file system to help create the udev rules.
–query=type Query the specified type of device from the database. –path and –name are required...
Reference: traders using Python
【Preface: Starting with this tutorial, all development will take place in a Python environment (thank goodbye to C++).
Introduction of the underlying interface
1、Usually, the structure of a trading process consists of the following three parts:
The underlying interface: responsible for docking quotations and trading APIs, pushing data to the system core, and sending instructions (order, data request, etc.)
Middle-level engine: Used to integrate components (including underlying interfaces, database interfaces, etc.) into an object for top-level UI calls
Top...