边数据

边数据(side data)是作业所需的额外的只读数据,以辅助处理主数据集。所面临的挑战在于如何使所有map或reduce任务(这些任务散布在集群内部)都能够方便而高效地使用边数据。

利用Job来配置作业

Configuration类的各种setter方法能够方便地配置作业的任一键值对。如果仅需向任务传递少量元数据则非常有用。用户可以通过Context类的getConfiguration()方法获得配置信息。
一般情况下,基本类型足以应付元数据编码。但对于更复杂的对象,用户要么自己处理序列化工作(这需要实现一个对象与字符串之间的双向转换机制),要么使用Hadoop提供的Stringifier类。DefaultStringifier使用Hadoop的序列化框架来序列化对象。
但是这种机制会加大Hadoop守护进程的内存开销压力,当几百个作业在系统中同时运行时这种现象尤为突出。因此,这种机制并不适合传输多达几千字节的数据量。每次读取配置时,所有项都被读入到内存(即使暂时不用的属性项也不例外)。MR1中,作业配置由jobtracker、tasktracker和子JVM读取,jobtracker和tasktracker均不使用用户的属性,因此这种做法有时既浪费时间,又浪费内存。

代码如下

  1. package com.zhen.mapreduce.sideData.job;
  2.  
  3. import java.io.IOException;
  4.  
  5. import org.apache.hadoop.conf.Configuration;
  6. import org.apache.hadoop.conf.Configured;
  7. import org.apache.hadoop.fs.Path;
  8. import org.apache.hadoop.io.LongWritable;
  9. import org.apache.hadoop.io.Text;
  10. import org.apache.hadoop.mapreduce.Job;
  11. import org.apache.hadoop.mapreduce.Mapper;
  12. import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
  13. import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
  14. import org.apache.hadoop.util.Tool;
  15. import org.apache.hadoop.util.ToolRunner;
  16.  
  17. /**
  18. * @author FengZhen
  19. * @date 2018年9月23日
  20. * 边数据(通过job configuration来设置)
  21. */
  22. public class SideData extends Configured implements Tool{
  23.  
  24. static class SideDataMapper extends Mapper<LongWritable, Text, Text, Text>{
  25. String sideDataValue = "";
  26. @Override
  27. protected void setup(Mapper<LongWritable, Text, Text, Text>.Context context)
  28. throws IOException, InterruptedException {
  29. sideDataValue = context.getConfiguration().get("sideData_test_key");
  30. }
  31.  
  32. @Override
  33. protected void map(LongWritable key, Text value, Mapper<LongWritable, Text, Text, Text>.Context context)
  34. throws IOException, InterruptedException {
  35. context.write(value, new Text(sideDataValue));
  36. }
  37. }
  38.  
  39. public int run(String[] args) throws Exception {
  40.  
  41. Configuration configuration = new Configuration();
  42. configuration.set("sideData_test_key", "sideData_test_value");
  43. Job job = Job.getInstance(configuration);
  44. job.setJobName("SideData");
  45. job.setJarByClass(getClass());
  46.  
  47. job.setMapperClass(SideDataMapper.class);
  48.  
  49. job.setMapOutputKeyClass(Text.class);
  50. job.setMapOutputValueClass(Text.class);
  51.  
  52. job.setNumReduceTasks(0);
  53.  
  54. FileInputFormat.addInputPath(job, new Path(args[0]));
  55. FileOutputFormat.setOutputPath(job, new Path(args[1]));
  56.  
  57. return job.waitForCompletion(true) ? 0 : 1;
  58. }
  59.  
  60. public static void main(String[] args) {
  61. try {
  62. String[] params = new String[] {
  63. "hdfs://fz/user/hdfs/MapReduce/data/sideData/job/input",
  64. "hdfs://fz/user/hdfs/MapReduce/data/sideData/job/output"
  65. };
  66. int exitCode = ToolRunner.run(new SideData(), params);
  67. System.exit(exitCode);
  68. } catch (Exception e) {
  69. e.printStackTrace();
  70. }
  71. }
  72.  
  73. }

 

分布式缓存

与在作业配置中序列化边数据的技术相比,Hadoop的分布式缓存机制更受青睐,它能够在任务运行过程中及时地将文件和存档复制到任务节点以供使用。为了节约网络带宽,在每一个作业中,各个文件通常只需复制到一个节点一次。

1.用法

对于使用GenericOptionsParser的工具来说,用户可以使用-files选项指定待分发的文件,文件内包含以逗号隔开的URL列表。文件可以存放在本地文件系统、HDFS或其他Hadoop可读文件系统之中(如S3).如果尚未指定文件系统,则这些文件被默认是本地的。即使默认文件系统并非本地文件系统,这也是成立的。
用户可以使用-archives选项向自己的任务中复制存档文件(JAR文件、ZIP文件、tar文件和gzipped tar文件),这些文件会被解档到任务节点。-libjars选项会把JAR文件添加到mapper和reducer任务的类路径中。如果作业JAR文件并非包含很多库JAR文件,这点会很有用。

代码如下

  1. package com.zhen.mapreduce.sideData.distributedCache;
  2.  
  3. import java.io.File;
  4. import java.io.IOException;
  5.  
  6. import org.apache.hadoop.conf.Configured;
  7. import org.apache.hadoop.fs.Path;
  8. import org.apache.hadoop.io.IntWritable;
  9. import org.apache.hadoop.io.LongWritable;
  10. import org.apache.hadoop.io.Text;
  11. import org.apache.hadoop.mapreduce.Job;
  12. import org.apache.hadoop.mapreduce.Mapper;
  13. import org.apache.hadoop.mapreduce.Reducer;
  14. import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
  15. import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
  16. import org.apache.hadoop.util.Tool;
  17. import org.apache.hadoop.util.ToolRunner;
  18. import org.apache.log4j.Logger;
  19.  
  20. /**
  21. * @author FengZhen
  22. * @date 2018年9月23日
  23. * 读取本地文件边数据
  24. * 读取不到该文件
  25. * hadoop jar SideData.jar com.zhen.mapreduce.sideData.distributedCache.MaxTemperatureByStationNameUsingDistributedCacheFile -files /usr/local/test/mr/stations-fixed-width.txt
  26. */
  27. public class MaxTemperatureByStationNameUsingDistributedCacheFile extends Configured implements Tool{
  28.  
  29. static Logger logger = Logger.getLogger(MaxTemperatureByStationNameUsingDistributedCacheFile.class);
  30.  
  31. static enum StationFile{STATION_SIZE};
  32.  
  33. static class StationTemperatureMapper extends Mapper<LongWritable, Text, Text, IntWritable>{
  34. private NcdcRecordParser parser = new NcdcRecordParser();
  35. @Override
  36. protected void map(LongWritable key, Text value, Mapper<LongWritable, Text, Text, IntWritable>.Context context)
  37. throws IOException, InterruptedException {
  38. parser.parse(value.toString());
  39. if (parser.isValidTemperature()) {
  40. context.write(new Text(parser.getStationId()), new IntWritable(parser.getTemperature()));
  41. }
  42. }
  43. }
  44.  
  45. static class MaxTemperatureReducerWithStationLookup extends Reducer<Text, IntWritable, Text, IntWritable>{
  46. private NcdcStationMetadata metadata;
  47.  
  48. @Override
  49. protected void setup(Reducer<Text, IntWritable, Text, IntWritable>.Context context)
  50. throws IOException, InterruptedException {
  51. metadata = new NcdcStationMetadata();
  52. File file = new File("stations-fixed-width.txt");
  53. metadata.initialize(file);
  54. context.getCounter(StationFile.STATION_SIZE).setValue(metadata.getStationMap().size());
  55. }
  56.  
  57. @Override
  58. protected void reduce(Text key, Iterable<IntWritable> values,
  59. Reducer<Text, IntWritable, Text, IntWritable>.Context context) throws IOException, InterruptedException {
  60. String stationName = metadata.getStationName(key.toString());
  61. int maxValue = Integer.MIN_VALUE;
  62. for (IntWritable value : values) {
  63. maxValue = Math.max(maxValue, value.get());
  64. }
  65. context.write(new Text(stationName), new IntWritable(maxValue));
  66. }
  67. }
  68.  
  69. public int run(String[] args) throws Exception {
  70. Job job = Job.getInstance(getConf());
  71. job.setJobName("MaxTemperatureByStationNameUsingDistributedCacheFile");
  72. job.setJarByClass(getClass());
  73.  
  74. job.setMapperClass(StationTemperatureMapper.class);
  75. job.setMapOutputKeyClass(Text.class);
  76. job.setMapOutputValueClass(IntWritable.class);
  77.  
  78. job.setReducerClass(MaxTemperatureReducerWithStationLookup.class);
  79. job.setOutputKeyClass(Text.class);
  80. job.setOutputValueClass(IntWritable.class);
  81.  
  82. FileInputFormat.setInputPaths(job, new Path(args[0]));
  83. FileOutputFormat.setOutputPath(job, new Path(args[1]));
  84.  
  85. return job.waitForCompletion(true) ? 0 : 1;
  86. }
  87.  
  88. public static void main(String[] args) {
  89. try {
  90. String[] params = new String[] {
  91. "hdfs://fz/user/hdfs/MapReduce/data/sideData/distributedCache/input",
  92. "hdfs://fz/user/hdfs/MapReduce/data/sideData/distributedCache/output"
  93. };
  94. int exitCode = ToolRunner.run(new MaxTemperatureByStationNameUsingDistributedCacheFile(), params);
  95. System.exit(exitCode);
  96. } catch (Exception e) {
  97. e.printStackTrace();
  98. }
  99. }
  100.  
  101. }

 解析天气数据

  1. package com.zhen.mapreduce.sideData.distributedCache;
  2.  
  3. import java.io.Serializable;
  4.  
  5. /**
  6. * @author FengZhen
  7. * @date 2018年9月9日
  8. * 解析天气数据
  9. */
  10. public class NcdcRecordParser implements Serializable{
  11.  
  12. private static final long serialVersionUID = 1L;
  13.  
  14. /**
  15. * 气象台ID
  16. */
  17. private String stationId;
  18. /**
  19. * 时间
  20. */
  21. private long timeStamp;
  22. /**
  23. * 气温
  24. */
  25. private Integer temperature;
  26.  
  27. /**
  28. * 解析
  29. * @param value
  30. */
  31. public void parse(String value) {
  32. String[] values = value.split(",");
  33. if (values.length >= 3) {
  34. stationId = values[0];
  35. timeStamp = Long.parseLong(values[1]);
  36. temperature = Integer.valueOf(values[2]);
  37. }
  38. }
  39.  
  40. /**
  41. * 校验是否合格
  42. * @return
  43. */
  44. public boolean isValidTemperature() {
  45. return null != temperature;
  46. }
  47.  
  48. public String getStationId() {
  49. return stationId;
  50. }
  51.  
  52. public void setStationId(String stationId) {
  53. this.stationId = stationId;
  54. }
  55.  
  56. public long getTimeStamp() {
  57. return timeStamp;
  58. }
  59.  
  60. public void setTimeStamp(long timeStamp) {
  61. this.timeStamp = timeStamp;
  62. }
  63.  
  64. public Integer getTemperature() {
  65. return temperature;
  66. }
  67.  
  68. public void setTemperature(Integer temperature) {
  69. this.temperature = temperature;
  70. }
  71.  
  72. }

 解析气象站数据

  1. package com.zhen.mapreduce.sideData.distributedCache;
  2.  
  3. import java.io.BufferedReader;
  4. import java.io.File;
  5. import java.io.FileReader;
  6. import java.util.HashMap;
  7. import java.util.Map;
  8.  
  9. /**
  10. * @author FengZhen
  11. * @date 2018年9月23日
  12. * 解析边数据
  13. */
  14. public class NcdcStationMetadata {
  15.  
  16. /**
  17. * 存放气象站ID和name
  18. */
  19. private Map<String, String> stationMap = new HashMap<String, String>();
  20.  
  21. public Map<String, String> getStationMap() {
  22. return stationMap;
  23. }
  24.  
  25. public void setStationMap(Map<String, String> stationMap) {
  26. this.stationMap = stationMap;
  27. }
  28.  
  29. /**
  30. * 根据ID获取name
  31. * @param stationId
  32. * @return
  33. */
  34. public String getStationName(String stationId) {
  35. return stationMap.get(stationId);
  36. }
  37.  
  38. /**
  39. * 解析
  40. * @param value
  41. */
  42. public boolean parse(String value) {
  43. String[] values = value.split(",");
  44. if (values.length >= 2) {
  45. String stationId = values[0];
  46. String stationName = values[1];
  47. if (null == stationMap) {
  48. stationMap = new HashMap<String, String>();
  49. }
  50. stationMap.put(stationId, stationName);
  51. return true;
  52. }
  53. return false;
  54. }
  55.  
  56. /**
  57. * 解析气象站数据文件
  58. * @param file
  59. */
  60. public void initialize(File file) {
  61.  
  62. BufferedReader reader=null;
  63. String temp=null;
  64. try{
  65. reader=new BufferedReader(new FileReader(file));
  66. System.out.println("------------------start------------------");
  67. while((temp=reader.readLine())!=null){
  68. System.out.println(temp);
  69. parse(temp);
  70. }
  71. System.out.println("------------------end------------------");
  72. }
  73. catch(Exception e){
  74. e.printStackTrace();
  75. }
  76. finally{
  77. if(reader!=null){
  78. try{
  79. reader.close();
  80. }
  81. catch(Exception e){
  82. e.printStackTrace();
  83. }
  84. }
  85. }
  86.  
  87. }
  88.  
  89. }

  

2.工作机制

当用户启动一个作业,Hadoop会把由-files、-archives和-libjars等选项所指定的文件复制到分布式文件系统(一般是HDFS)之中。接着,在任务运行之前,tasktracker(YARN中NodeManager)将文件从分布式文件系统复制到本地磁盘(缓存)使任务能够访问文件。此时,这些文件就被视为本地化了。从任务的角度看,这些文件就已经在那儿了(它并不关心这些文件是否来自HDFS)。此外,由-libjars指定的文件会在任务启动前添加到任务的类路径(classpath)中。

tasktracker(YARN中NodeManager)为缓存中的文件各维护一个计数器来统计这些文件的被使用情况。当任务即将运行时,该任务所使用的所有文件的对应计数器值增1;当任务执行完毕之后,这些计数器值均减1.当相关计数器值为0时,表明该文件没有被任何任务使用,可以从缓存中移除。缓存的容量是有限的(默认10GB),因此需要经常删除无用的文件以腾出空间来装载新文件。缓存大小可以通过属性local.cache.size进行配置,以字节为单位。

尽管该机制并不确保在同一个tasktracker上运行的同一作业的后续任务肯定能在缓存中找到文件,但是成功的概率相当大。原因在于作业的多个任务在调度之后几乎同时开始运行,因此,不会有足够多的其他作业在运行而导致原始任务的文件从缓存中被删除。
文件存放在tasktracker的${mapred.local.dir}/taskTracker/archive目录下。但是应用程序不必知道这一点,因为这些文件同时以符号链接的方式指向任务的工作目录。

3.分布式缓存API

由于可以通过GenericOptionsParser间接使用分布式缓存,大多数应用不需要使用分布式缓存API。然而,一些应用程序需要用到分布式缓存的更高级的特性,这就需要直接使用API了。API包括两部分:将数据放到缓存中的方法,以及从缓存中读取数据的方法。

  1. public void addCacheFile(URI uri)
  2. public void addCacheArchive(URI uri)
  3. public void setCacheFiles(URI[] files)
  4. public void setCacheArchives(URI[] archives)
  5. public void addFileToClassPath(Path file)
  6. public void addArchiveToClassPath(Path archive)

在缓存中可以存放两类对象:文件(files)和存档(archives)。文件被直接放置在任务节点上,而存档则会被解档之后再将具体文件放置在任务节点上。每种对象类型都包含三种方法:addCacheXXX()、setCacheXXXs()和addXXXToClassPath()。其中,addCacheXXX()方法将文件或存档添加到分布式缓存,setCacheXXXs()方法将一次性向分布式缓存中添加一组文件或存档(之前调用所生成的集合将被替换),addXXXToClassPath()方法将文件或存档添加到MapReduce任务的类路径。
代码如下(有问题,读不到文件)

  1. package com.zhen.mapreduce.sideData.distributedCache;
  2.  
  3. import java.io.File;
  4. import java.io.FileNotFoundException;
  5. import java.io.IOException;
  6. import java.net.URI;
  7.  
  8. import org.apache.hadoop.conf.Configured;
  9. import org.apache.hadoop.fs.Path;
  10. import org.apache.hadoop.io.IntWritable;
  11. import org.apache.hadoop.io.LongWritable;
  12. import org.apache.hadoop.io.Text;
  13. import org.apache.hadoop.mapreduce.Job;
  14. import org.apache.hadoop.mapreduce.Mapper;
  15. import org.apache.hadoop.mapreduce.Reducer;
  16. import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
  17. import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
  18. import org.apache.hadoop.util.Tool;
  19. import org.apache.hadoop.util.ToolRunner;
  20. import org.apache.log4j.Logger;
  21.  
  22. /**
  23. * @author FengZhen
  24. * @date 2018年9月23日
  25. * 读取本地文件边数据
  26. * 有问题,空指针,读不到文件
  27. * hadoop jar SideData.jar com.zhen.mapreduce.sideData.distributedCache.MaxTemperatureByStationNameUsingDistributedCacheFileAPI
  28. */
  29. public class MaxTemperatureByStationNameUsingDistributedCacheFileAPI extends Configured implements Tool{
  30.  
  31. static Logger logger = Logger.getLogger(MaxTemperatureByStationNameUsingDistributedCacheFileAPI.class);
  32.  
  33. static enum StationFile{STATION_SIZE};
  34.  
  35. static class StationTemperatureMapper extends Mapper<LongWritable, Text, Text, IntWritable>{
  36. private NcdcRecordParser parser = new NcdcRecordParser();
  37. @Override
  38. protected void map(LongWritable key, Text value, Mapper<LongWritable, Text, Text, IntWritable>.Context context)
  39. throws IOException, InterruptedException {
  40. parser.parse(value.toString());
  41. if (parser.isValidTemperature()) {
  42. context.write(new Text(parser.getStationId()), new IntWritable(parser.getTemperature()));
  43. }
  44. }
  45. }
  46.  
  47. static class MaxTemperatureReducerWithStationLookup extends Reducer<Text, IntWritable, Text, IntWritable>{
  48. private NcdcStationMetadata metadata;
  49.  
  50. @Override
  51. protected void setup(Reducer<Text, IntWritable, Text, IntWritable>.Context context)
  52. throws IOException, InterruptedException {
  53. metadata = new NcdcStationMetadata();
  54. URI[] localPaths = context.getCacheFiles();
  55. if (localPaths.length == 0) {
  56. throw new FileNotFoundException("Distributed cache file not found.");
  57. }
  58. File file = new File(localPaths[0].getPath().toString());
  59. metadata.initialize(file);
  60. context.getCounter(StationFile.STATION_SIZE).setValue(metadata.getStationMap().size());
  61.  
  62. }
  63.  
  64. @Override
  65. protected void reduce(Text key, Iterable<IntWritable> values,
  66. Reducer<Text, IntWritable, Text, IntWritable>.Context context) throws IOException, InterruptedException {
  67. String stationName = metadata.getStationName(key.toString());
  68. int maxValue = Integer.MIN_VALUE;
  69. for (IntWritable value : values) {
  70. maxValue = Math.max(maxValue, value.get());
  71. }
  72. context.write(new Text(stationName), new IntWritable(maxValue));
  73. }
  74. }
  75.  
  76. public int run(String[] args) throws Exception {
  77. Job job = Job.getInstance(getConf());
  78. job.setJobName("MaxTemperatureByStationNameUsingDistributedCacheFileAPI");
  79. job.setJarByClass(getClass());
  80.  
  81. job.setMapperClass(StationTemperatureMapper.class);
  82. job.setMapOutputKeyClass(Text.class);
  83. job.setMapOutputValueClass(IntWritable.class);
  84.  
  85. job.setReducerClass(MaxTemperatureReducerWithStationLookup.class);
  86. job.setOutputKeyClass(Text.class);
  87. job.setOutputValueClass(IntWritable.class);
  88.  
  89. job.addCacheFile(new URI("hdfs://fz/user/hdfs/MapReduce/data/sideData/distributedCache/stations-fixed-width.txt"));
  90. FileInputFormat.setInputPaths(job, new Path(args[0]));
  91. FileOutputFormat.setOutputPath(job, new Path(args[1]));
  92.  
  93. return job.waitForCompletion(true) ? 0 : 1;
  94. }
  95.  
  96. public static void main(String[] args) {
  97. try {
  98. String[] params = new String[] {
  99. "hdfs://fz/user/hdfs/MapReduce/data/sideData/distributedCache/input",
  100. "hdfs://fz/user/hdfs/MapReduce/data/sideData/distributedCache/output"
  101. };
  102. int exitCode = ToolRunner.run(new MaxTemperatureByStationNameUsingDistributedCacheFileAPI(), params);
  103. System.exit(exitCode);
  104. } catch (Exception e) {
  105. e.printStackTrace();
  106. }
  107. }
  108.  
  109. }

  

MapReduce-边数据的更多相关文章

  1. MapReduce的数据流程、执行流程

    MapReduce的数据流程: 预先加载本地的输入文件 经过MAP处理产生中间结果 经过shuffle程序将相同key的中间结果分发到同一节点上处理 Recude处理产生结果输出 将结果输出保存在hd ...

  2. Hadoop基础-MapReduce的数据倾斜解决方案

    Hadoop基础-MapReduce的数据倾斜解决方案 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.数据倾斜简介 1>.什么是数据倾斜 答:大量数据涌入到某一节点,导致 ...

  3. mapreduce清洗数据

    继上篇 MapReduce清洗数据 package mapreduce; import java.io.IOException; import org.apache.hadoop.conf.Confi ...

  4. Hadoop第7周练习—MapReduce进行数据查询和实现推简单荐系统

    1.1 1.2 :计算员工相关 2.1 内容 :求各个部门的总工资 :求各个部门的人数和平均工资 :求每个部门最早进入公司的员工姓名 :求各个城市的员工的总工资 :列出工资比上司高的员工姓名及其工资 ...

  5. MapReduce 实现数据join操作

    前段时间有一个业务需求,要在外网商品(TOPB2C)信息中加入 联营自营 识别的字段.但存在的一个问题是,商品信息 和 自营联营标示数据是 两份数据:商品信息较大,是存放在hbase中.他们之前唯一的 ...

  6. MongoDB 的 MapReduce 大数据统计统计挖掘

    MongoDB虽然不像我们常用的mysql,sqlserver,oracle等关系型数据库有group by函数那样方便分组,但是MongoDB要实现分组也有3个办法: * Mongodb三种分组方式 ...

  7. Mapreduce——视频播放数据分类统计

    很多视频网站都有电视剧热度排名,一般是依据用户在自己站的行为数据所体现出的受欢迎程度来排名.这里有一份来自优酷.爱奇艺.搜索视频等五大视频网站的一份视频播放数据,我们利用这份数据做些有意义的事情. 金 ...

  8. MapReduce实例(数据去重)

    数据去重: 原理(理解):Mapreduce程序首先应该确认<k3,v3>,根据<k3,v3>确定<k2,v2>,原始数据中出现次数超过一次的数据在输出文件中只出现 ...

  9. 利用MapReduce实现数据去重

    数据去重主要是为了利用并行化的思想对数据进行有意义的筛选. 统计大数据集上的数据种类个数.从网站日志中计算访问地等这些看似庞杂的任务都会涉及数据去重. 示例文件内容: 此处应有示例文件 设计思路 数据 ...

  10. hadoop mapreduce实现数据去重

    实现原理分析: map函数数将输入的文本按照行读取,   并将Key--每一行的内容   输出    value--空. reduce  会自动统计所有的key,我们让reduce输出key-> ...

随机推荐

  1. Java 基础巩固,根深而叶茂

    #J2SE ##基础 八种基本数据类型的大小,以及他们的封装类. 八种基本数据类型,int ,double ,long ,float, short,byte,character,boolean 对应的 ...

  2. iOS学习笔记(二)——Hello iOS

    前面写了iOS开发环境搭建,只简单提了一下安装Xcode,这里再补充一下,点击下载Xcode的dmp文件,稍等片刻会有图一(拖拽Xcode至Applications)的提示,拖拽至Applicatio ...

  3. 《从零开始学Swift》学习笔记(Day 35)——会使用下标吗?

    原创文章,欢迎转载.转载请注明:关东升的博客 看下面的示例代码是不是使用过: var studentList: String[] = ["张三","李四",&q ...

  4. VS2012如何显示行号

    Tools-Options-Text Editor-All Languages –General – Display

  5. 使用MyBatis_Generator工具jar包自动化生成Dto、Dao、Mapping 文件

    由于MyBatis属于一种半自动的ORM框架,所以主要的工作将是书写Mapping映射文件,但是由于手写映射文件很容易出错,所以查资料发现有现成的工具可以自动生成底层模型类.Dao接口类甚至Mappi ...

  6. SpringBoot-------实现多数据源Demo

    之前SpringBoot出来时候就看了下Springboot,感觉的确精简掉了配置文件! 还是很方便的!没办法,我只是个菜鸟! 什么怎么启动Springboot什么的就不说了, 具体的Demo地址我都 ...

  7. ssm框架整合-过程总结(第三次周总结)

    本周主要是完成前端界面和后端的整合. 犹豫前后端的工作完成程度不一致,只实现了部分整合. 登录界面. 可能自己最近没有把重心放在短学期的项目上,导致我们工作的总体进度都要比别慢. 虽然我们只是三个人的 ...

  8. 小白学linux命令

    小白是景女神全栈开发股份有限公司的一名财务实习员工,经过3个月的实习期,小白是过五关斩六将啊!终于成为了公司的一名正式员工,而且收到了景总亲自发来贺喜的邮件:“欢迎你加入大家庭,公司也本着员工全面发展 ...

  9. Qt for Android 启动短暂的黑屏或白屏问题如何解决?

    解决方法一: 使用透明主题 点击项目 -> 在 构建设置 里面找到 Build Android APK 栏目,点击 create templates 创建一个 AndroidManifest.x ...

  10. GitHub命名规则

    ● Added ( 新加入的需求 ) ● Fixed ( 修复 bug ) ● Changed ( 完成的任务 ) ● Updated ( 完成的任务,或者由于第三方模块变化而做的变化 )