@Test @Category(UnitTest.class) public void testExists() throws Exception { Assert.assertTrue("Can not open file!", factory.exists(junk, conf, providerProperties)); }
@Override public boolean exists(final String input, final Configuration conf, final ProviderProperties providerProperties) throws IOException { Properties oldProviderProperties = AccumuloUtils.providerPropertiesToProperties(providerProperties); ADPF_ImageToTable = AccumuloUtils.getGeoTables(oldProviderProperties); if (ADPF_AllTables == null) { ADPF_AllTables = AccumuloUtils.getListOfTables(oldProviderProperties); } String t = input; if (input.startsWith(MrGeoAccumuloConstants.MRGEO_ACC_PREFIX)) { t = input.replaceFirst(MrGeoAccumuloConstants.MRGEO_ACC_PREFIX, ""); } if (ADPF_ImageToTable != null) { StringBuffer sb = new StringBuffer(); for (String k : ADPF_ImageToTable.keySet()) { if (sb.length() != 0) { sb.append(" "); } sb.append(k); } log.info("table " + t + " exists=" + Boolean.toString(ADPF_AllTables.contains(t)) + " and is a map table=" + Boolean.toString(ADPF_ImageToTable.containsKey(t))); return ADPF_ImageToTable.containsKey(t); } return false; }
AccumuloMrsImageDataProviderFactory implements MrsImageDataProviderFactory { @Override public boolean exists(final String input, final Configuration conf, final ProviderProperties providerProperties) throws IOException { Properties oldProviderProperties = AccumuloUtils.providerPropertiesToProperties(providerProperties); ADPF_ImageToTable = AccumuloUtils.getGeoTables(oldProviderProperties); if (ADPF_AllTables == null) { ADPF_AllTables = AccumuloUtils.getListOfTables(oldProviderProperties); } String t = input; if (input.startsWith(MrGeoAccumuloConstants.MRGEO_ACC_PREFIX)) { t = input.replaceFirst(MrGeoAccumuloConstants.MRGEO_ACC_PREFIX, ""); } if (ADPF_ImageToTable != null) { StringBuffer sb = new StringBuffer(); for (String k : ADPF_ImageToTable.keySet()) { if (sb.length() != 0) { sb.append(" "); } sb.append(k); } log.info("table " + t + " exists=" + Boolean.toString(ADPF_AllTables.contains(t)) + " and is a map table=" + Boolean.toString(ADPF_ImageToTable.containsKey(t))); return ADPF_ImageToTable.containsKey(t); } return false; } }
AccumuloMrsImageDataProviderFactory implements MrsImageDataProviderFactory { @Override public boolean exists(final String input, final Configuration conf, final ProviderProperties providerProperties) throws IOException { Properties oldProviderProperties = AccumuloUtils.providerPropertiesToProperties(providerProperties); ADPF_ImageToTable = AccumuloUtils.getGeoTables(oldProviderProperties); if (ADPF_AllTables == null) { ADPF_AllTables = AccumuloUtils.getListOfTables(oldProviderProperties); } String t = input; if (input.startsWith(MrGeoAccumuloConstants.MRGEO_ACC_PREFIX)) { t = input.replaceFirst(MrGeoAccumuloConstants.MRGEO_ACC_PREFIX, ""); } if (ADPF_ImageToTable != null) { StringBuffer sb = new StringBuffer(); for (String k : ADPF_ImageToTable.keySet()) { if (sb.length() != 0) { sb.append(" "); } sb.append(k); } log.info("table " + t + " exists=" + Boolean.toString(ADPF_AllTables.contains(t)) + " and is a map table=" + Boolean.toString(ADPF_ImageToTable.containsKey(t))); return ADPF_ImageToTable.containsKey(t); } return false; } AccumuloMrsImageDataProviderFactory(); }
AccumuloMrsImageDataProviderFactory implements MrsImageDataProviderFactory { @Override public boolean exists(final String input, final Configuration conf, final ProviderProperties providerProperties) throws IOException { Properties oldProviderProperties = AccumuloUtils.providerPropertiesToProperties(providerProperties); ADPF_ImageToTable = AccumuloUtils.getGeoTables(oldProviderProperties); if (ADPF_AllTables == null) { ADPF_AllTables = AccumuloUtils.getListOfTables(oldProviderProperties); } String t = input; if (input.startsWith(MrGeoAccumuloConstants.MRGEO_ACC_PREFIX)) { t = input.replaceFirst(MrGeoAccumuloConstants.MRGEO_ACC_PREFIX, ""); } if (ADPF_ImageToTable != null) { StringBuffer sb = new StringBuffer(); for (String k : ADPF_ImageToTable.keySet()) { if (sb.length() != 0) { sb.append(" "); } sb.append(k); } log.info("table " + t + " exists=" + Boolean.toString(ADPF_AllTables.contains(t)) + " and is a map table=" + Boolean.toString(ADPF_ImageToTable.containsKey(t))); return ADPF_ImageToTable.containsKey(t); } return false; } AccumuloMrsImageDataProviderFactory(); @Override boolean isValid(); @Override void initialize(Configuration conf); @Override String getPrefix(); @Override Map<String, String> getConfiguration(); @Override void setConfiguration(Map<String, String> properties); @Override MrsImageDataProvider createTempMrsImageDataProvider(final Configuration conf,
                                                           ProviderProperties providerProperties); @Override MrsImageDataProvider createMrsImageDataProvider(final String input,
                                                       final Configuration conf,
                                                       final ProviderProperties providerProperties); @Override boolean canOpen(final String input,
                       final Configuration conf,
                       final ProviderProperties providerProperties); @Override String[] listImages(final Configuration conf,
                           final ProviderProperties providerProperties); @Override boolean canWrite(final String input,
                        final Configuration conf,
                        final ProviderProperties providerProperties); @Override boolean exists(final String input,
                      final Configuration conf,
                      final ProviderProperties providerProperties); @Override void delete(final String name,
                   final Configuration conf,
                   final ProviderProperties providerProperties); }
AccumuloMrsImageDataProviderFactory implements MrsImageDataProviderFactory { @Override public boolean exists(final String input, final Configuration conf, final ProviderProperties providerProperties) throws IOException { Properties oldProviderProperties = AccumuloUtils.providerPropertiesToProperties(providerProperties); ADPF_ImageToTable = AccumuloUtils.getGeoTables(oldProviderProperties); if (ADPF_AllTables == null) { ADPF_AllTables = AccumuloUtils.getListOfTables(oldProviderProperties); } String t = input; if (input.startsWith(MrGeoAccumuloConstants.MRGEO_ACC_PREFIX)) { t = input.replaceFirst(MrGeoAccumuloConstants.MRGEO_ACC_PREFIX, ""); } if (ADPF_ImageToTable != null) { StringBuffer sb = new StringBuffer(); for (String k : ADPF_ImageToTable.keySet()) { if (sb.length() != 0) { sb.append(" "); } sb.append(k); } log.info("table " + t + " exists=" + Boolean.toString(ADPF_AllTables.contains(t)) + " and is a map table=" + Boolean.toString(ADPF_ImageToTable.containsKey(t))); return ADPF_ImageToTable.containsKey(t); } return false; } AccumuloMrsImageDataProviderFactory(); @Override boolean isValid(); @Override void initialize(Configuration conf); @Override String getPrefix(); @Override Map<String, String> getConfiguration(); @Override void setConfiguration(Map<String, String> properties); @Override MrsImageDataProvider createTempMrsImageDataProvider(final Configuration conf,
                                                           ProviderProperties providerProperties); @Override MrsImageDataProvider createMrsImageDataProvider(final String input,
                                                       final Configuration conf,
                                                       final ProviderProperties providerProperties); @Override boolean canOpen(final String input,
                       final Configuration conf,
                       final ProviderProperties providerProperties); @Override String[] listImages(final Configuration conf,
                           final ProviderProperties providerProperties); @Override boolean canWrite(final String input,
                        final Configuration conf,
                        final ProviderProperties providerProperties); @Override boolean exists(final String input,
                      final Configuration conf,
                      final ProviderProperties providerProperties); @Override void delete(final String name,
                   final Configuration conf,
                   final ProviderProperties providerProperties);  }