public int run(String[] args) throws IOException { if (args.length != 1) { System.err.println("Usage: HBaseStationImporter <input>"); return -1; } HTable table = new HTable(new HBaseConfiguration(getConf()), "stations"); NcdcStationMetadata metadata = new NcdcStationMetadata(); metadata.initialize(new File(args[0])); Map<String, String> stationIdToNameMap = metadata.getStationIdToNameMap(); for (Map.Entry<String, String> entry : stationIdToNameMap.entrySet()) { byte[] rowKey = Bytes.toBytes(entry.getKey()); BatchUpdate bu = new BatchUpdate(rowKey); bu.put("info:name", Bytes.toBytes(entry.getValue())); bu.put("info:description", Bytes.toBytes("Description...")); bu.put("info:location", Bytes.toBytes("Location...")); table.commit(bu); } return 0; }