Skip to content

Commit 0cf045f

Browse files
adding more comments
1 parent e012256 commit 0cf045f

File tree

5 files changed

+20
-0
lines changed

5 files changed

+20
-0
lines changed

src/main/java/ca/uwaterloo/cs651/a3/BuildInvertedIndex.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,27 @@
5151

5252
public class BuildInvertedIndex extends Configured implements Tool {
5353
private static final Logger LOG = Logger.getLogger(BuildInvertedIndex.class);
54+
// 1. 工具类
55+
// private static final Logger LOG = Logger.getLogger();
56+
57+
58+
// 2. 计数器/统计
59+
// private static int totalUsers = 0;
60+
61+
// // 静态成员:可以直接通过类访问
62+
// Math.PI // 不需要创建实例
63+
// Logger.getLogger() // 静态方法调用
64+
65+
// 非静态成员:必须通过实例访问
66+
// Counter c = new Counter();
67+
// c.instanceCount // 需要实例
5468

69+
// 3. 共享资源
70+
// private static final DatabaseConnection DB;
71+
72+
// 4. 常量
73+
// public static final double PI = 3.14159;
74+
5575
private static final class MyMapper extends Mapper<LongWritable, Text, Text, PairOfInts> {
5676
private static final Text WORD = new Text();
5777
private static final Object2IntFrequencyDistribution<String> COUNTS =
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)