}
}, Beacon.SCHEMA$, AvroFormat.BINARY, null);
Properties p = new Properties();
p.load(getClass().getResourceAsStream("creds.properties"));
ProviderCredentials pc = new AWSCredentials(p.getProperty("AWS_ACCESS_KEY_ID"), p.getProperty("AWS_SECRET_ACCESS_KEY"));
final RestS3Service s3 = new RestS3Service(pc);
S3Object[] s3Objects = s3.listObjects("com.bagcheck.archive", "beacons/", null);
ExecutorService es = Executors.newCachedThreadPool();
List<Callable<Void>> callables = new ArrayList<Callable<Void>>();
for (final S3Object s3Object : s3Objects) {
if (!s3Object.getName().equals("beacons/")) {
callables.add(new Callable<Void>() {
@Override
public Void call() throws Exception {
S3Object object = s3.getObject(s3Object.getBucketName(), s3Object.getName());
DataInputStream dis = new DataInputStream(new GZIPInputStream(object.getDataInputStream()));
byte[] bytes = new byte[dis.readInt()];
dis.readFully(bytes);
byte[] valuebytes = new byte[1024];
Schema writerSchema = Schema.parse(new ByteArrayInputStream(bytes));