2025-03-26 02:12:17 +00:00
|
|
|
import org.apache.hadoop.conf.Configuration;
|
|
|
|
import org.apache.hadoop.hbase.*;
|
|
|
|
import org.apache.hadoop.hbase.client.*;
|
|
|
|
import org.apache.hadoop.hbase.util.Bytes;
|
|
|
|
import java.io.*;
|
|
|
|
import java.security.MessageDigest;
|
|
|
|
import java.security.NoSuchAlgorithmException;
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
public class HBaseEmpManager {
|
2025-03-26 03:15:47 +00:00
|
|
|
public static void main(String[] args) {
|
2025-03-26 02:26:02 +00:00
|
|
|
try {
|
2025-03-26 03:15:47 +00:00
|
|
|
HBaseConnectionManager.init();
|
|
|
|
HBaseTableManager.createTable(HBaseConnectionManager.getAdmin());
|
|
|
|
|
|
|
|
EmployeeDAO employeeDAO = new EmployeeDAO();
|
|
|
|
employeeDAO.insertData("emp.txt");
|
|
|
|
employeeDAO.queryById();
|
|
|
|
employeeDAO.queryByPerformance();
|
|
|
|
employeeDAO.queryRecentPromotion();
|
|
|
|
|
|
|
|
TrainingDAO trainingDAO = new TrainingDAO();
|
|
|
|
trainingDAO.countTrainingParticipants();
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
2025-03-26 02:26:02 +00:00
|
|
|
e.printStackTrace();
|
2025-03-26 03:15:47 +00:00
|
|
|
} finally {
|
|
|
|
HBaseConnectionManager.close();
|
2025-03-26 02:26:02 +00:00
|
|
|
}
|
|
|
|
}
|
2025-03-26 02:12:17 +00:00
|
|
|
}
|