FSStorageAgent implements StorageAgent, Serializable { @Override public void delete(int operatorId, long windowId) throws IOException { Path lPath = new Path(path + Path.SEPARATOR + String.valueOf(operatorId) + Path.SEPARATOR + Long.toHexString(windowId)); logger.debug("Deleting: {}", lPath); fileContext.delete(lPath, false); } protected  FSStorageAgent();  FSStorageAgent(String path, Configuration conf); @SuppressWarnings("ThrowFromFinallyBlock") @Override void save(Object object, int operatorId, long windowId); @Override Object load(int operatorId, long windowId); @Override void delete(int operatorId, long windowId); @Override long[] getWindowIds(int operatorId); static void store(OutputStream stream, Object operator); static Object retrieve(InputStream stream); Object readResolve(); static final String TMP_FILE; final String path; }
@Test public void testDelete() throws IOException { testLoad(); testMeta.storageAgent.delete(1, 1); Path appPath = new Path(testMeta.applicationPath); FileContext fileContext = FileContext.getFileContext(); Assert.assertTrue("operator 2 window 1", fileContext.util().exists(new Path(appPath + "/" + 2 + "/" + 1))); Assert.assertFalse("operator 1 window 1", fileContext.util().exists(new Path(appPath + "/" + 1 + "/" + 1))); }