bool DirectoryIterator::hasNext() {
    if (next >= lists.size()) {
        return getListing();
    }

    return true;
}
Hdfs::FileStatus DirectoryIterator::getNext() {
    if (next >= lists.size()) {
        if (!getListing()) {
            THROW(HdfsIOException, "End of the dir flow");
        }
    }

    return lists[next++];
}
Beispiel #3
0
	void HyperNamespace::getListing( const std::vector<Hypertable::NamespaceListing>& listing, ht4c::Common::NamespaceListing& nsListing ) {
		for( std::vector<Hypertable::NamespaceListing>::const_iterator it = listing.begin(); it != listing.end(); ++it ) {
			if( (*it).is_namespace ) {
				getListing( (*it).sub_entries, nsListing.addNamespace(ht4c::Common::NamespaceListing((*it).name)));
			}
			else if( (*it).name.size() && (*it).name.front() != '^' ) {
				nsListing.addTable( (*it).name );
			}
		}
	}
Beispiel #4
0
	void HyperNamespace::getListing( bool deep, ht4c::Common::NamespaceListing& nsListing ) {
		nsListing = ht4c::Common::NamespaceListing( getName() );

		HT4C_TRY {
			std::vector<Hypertable::NamespaceListing> listing;
			ns->get_listing( deep, listing );
			getListing( listing, nsListing );
		}
		HT4C_RETHROW
	}