@Override public void run() throws Exception { SemaphoreService service = getService(); for (SemaphoreContainer semaphoreContainer : migrationData.values()) { semaphoreContainer.setInitialized(); } service.insertMigrationData(migrationData); }
@Override protected void writeInternal(ObjectDataOutput out) throws IOException { out.writeInt(migrationData.size()); for (Map.Entry<String, SemaphoreContainer> entry : migrationData.entrySet()) { String key = entry.getKey(); SemaphoreContainer value = entry.getValue(); out.writeUTF(key); value.writeData(out); } }
@Override protected void readInternal(ObjectDataInput in) throws IOException { int size = in.readInt(); migrationData = new HashMap<String, SemaphoreContainer>(size); for (int i = 0; i < size; i++) { String name = in.readUTF(); SemaphoreContainer semaphoreContainer = new SemaphoreContainer(); semaphoreContainer.readData(in); migrationData.put(name, semaphoreContainer); } }