FTP file upload and download
During the development of uploading and downloading files on FTP, you can log in to the FTP server, but the upload and download always report an error. After that, the FTPClient.enterLocalPassiveMode() method is added before the operation. Success.Note: call ftp client. Enterlocalpassivemode(); this method means that before each data connectio ...
Posted by kidsleep on Tue, 03 Dec 2019 03:34:32 -0800
Java import Excel tool class tutorial
Preface:
This tool class provides the excel import function. Through the reflection mechanism, the data in excel is mapped to the entity class to obtain Excel data. The tool class depends on the org.apache.poi package. It supports RESTful API and Spring MVC.
I. supporting functions of this tool class:
Support File type impo ...
Posted by Forever_xxl on Mon, 02 Dec 2019 19:10:28 -0800
Using IO stream to write files
Preface
When it is necessary to operate on files, it is inevitable to use IO flow; for example, some contents in the response results of some requests need to be stored in the business. When the file to be processed is too large, if you close the file stream frequently, it will cause a lot of overhead. When do you close it? It often causes grea ...
Posted by SkyRanger on Mon, 02 Dec 2019 09:16:12 -0800
Configure Apache virtual host
Experimental environment
A CentOS 7.3 virtual machine with minimal installation
Configure the base environment
1. Install apache
yum install -y httpd
2. Establish the root directory of the virtual host
mkdir /var/wwwroot
mkdir /var/wwwroot/site1
mkdir /var/wwwroot/site2
echo -e "site1" >> /var/wwwroot/site1/index.html
echo -e "site2" &g ...
Posted by m3mn0n on Sun, 01 Dec 2019 05:24:04 -0800
Java Socket framework Apache MINA: implement Socket server
Java Socket framework Apache MINA: implement Socket server
Now, Apache MINA is used to realize a simple Socket Server. The Server implements a simple function. When a Socket client connects, it sends a simple string "zhangphil" to the client. The Server-side program code is as follows:
import java.net.InetSocketAddr ...
Posted by Xo_ on Sat, 30 Nov 2019 05:05:33 -0800
Election mechanism for Pulsar Functions Worker
abstract
In Pulsar, Function, Source, and Link are all running on Function Worker, and you can refer to Function for reference An article about Pulsar Functions , you can refer to the use of Source and Link
Introduction to Pular Source
Pular Sink Getting Started Guide.
This paper introduces the election mechanism of Functions Worker.Read th ...
Posted by theironchef on Fri, 29 Nov 2019 20:39:52 -0800
[Flume] - collect Log4j log and send it to Kafka
Flume collects Log4j logs and sends them to Kafka for storage
Environmental preparation
Download Flume: http://flume.apache.org/
Install: extract the download package to the custom path
Configure agent
# Function: filter json information storage kafka
agent.sources = s1
agent.channels = c1
agent.sinks = k1
agent.sources.s1.type = avro
agen ...
Posted by mirana on Fri, 29 Nov 2019 12:57:00 -0800
Implementation of distributed globally unique ID generator (supporting multiple registries)
In the business scenarios of order and payment, the generation rules and methods of DOC No. are very important. There are many kinds of implementation. The simplest one is based on mysql auto add primary key. The advantages and disadvantages of the scheme are not much discussed, and everyone knows. Today, we implement a distrib ...
Posted by lentin64 on Fri, 29 Nov 2019 12:02:28 -0800
Hadoop MapReduce case - statistics of mobile phone uplink traffic, downlink traffic and total traffic
The format of the log is as follows: required fields, the second column: mobile number (user), the third last column: uplink traffic, the second last column: downlink popular
Train of thought:
Encapsulate the uplink traffic, downlink traffic and total traffic into an object bean. In the map, context.write (cell phone number ...
Posted by cloudbase on Fri, 29 Nov 2019 09:44:30 -0800
Getting started with Java Web -- installing Tomcat server in Linux Environment
Absrtact: This article mainly studied how to install Tomcat server in Linux environment.
Preparation
Check Java environment variables
Check whether the system is configured with Java environment variables:
1 [root@localhost ~]# java -version
2 java version "1.8.0_91"
3 Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
4 Java HotSpot(TM) 64- ...
Posted by Dethman on Fri, 29 Nov 2019 03:48:54 -0800