public void sync(Collection<String> names) throws IOException {
Set<String> toSync = new HashSet<String>(names);
Set<String> toSyncHdfs = new HashSet<String>(names);
Configuration conf = getConf();
FileSystemDirectory dir=null;
for (String name : names)
{
if (this.links.containsKey(name)) {
File file = this.links.get(name);
this.fsync(file);
}else if (this.hdfsLinks.containsKey(name)) {
Path p = this.hdfsLinks.get(name);
if(dir==null)
{
try {
dir=new FileSystemDirectory(FileSystem.get(conf), p.getParent(), false, conf);
} catch (IOException e) {
SolrCore.log.error("hdfs",e);
}
}
toSyncHdfs.add(name);
}else{
toSync.add(name);
}
}
if(dir!=null)
{
dir.sync(toSyncHdfs);
}
super.sync(toSync);
}