Home || Visual Search || Applications || Architecture || Important Messages || OGL || Src

FeatureTable* Impala::Persistency::FeatureTableRepositoryInFile::Get ( const FeatureLocator loc  )  [inline]

Definition at line 36 of file FeatureTableRepositoryInFile.h.

References Impala::Util::Broadcast(), GetDir(), Impala::Persistency::FeatureLocator::GetFeatureDef(), Impala::Persistency::FeatureLocator::GetFeatureString(), Impala::Persistency::RepositoryInFileSystem::GetFile(), Impala::Persistency::File::GetReadBuffer(), Impala::Persistency::FeatureLocator::GetSuffix(), Impala::Persistency::FeatureLocator::GetUseBroadcast(), ILOG_ERROR, Impala::Util::Read(), RepFS(), Impala::Util::IOBuffer::Valid(), and Impala::Persistency::File::Valid().

00037     {
00038         FeatureTable* res = new FeatureTable(loc.GetFeatureDef());
00039         String dir = GetDir(loc, false);
00040         String name = loc.GetFeatureString() + loc.GetSuffix();
00041         if (!(loc.GetUseBroadcast() && Link::Mpi::MpiUsed()))
00042         {
00043             File file = RepFS().GetFile(loc, dir, name, false, false);
00044             if (!file.Valid())
00045                 return 0;
00046             Read(res, file);
00047         }
00048         else
00049         {
00050             // In MPI mode only node0 reads the table, then it is broadcasted
00051             Util::IOBuffer* buf = 0;
00052             int myId = Link::Mpi::MyId();
00053             int root = 0;
00054             if (myId == root)
00055             {
00056                 File file = RepFS().GetFile(loc, dir, name, false, false);
00057                 buf = file.GetReadBuffer(true, "");
00058                 if (buf == 0 || !buf->Valid())
00059                 {
00060                     ILOG_ERROR("node0 couldn't open file");
00061                 }
00062             }
00063             else
00064             {
00065                 buf = new Util::IOBuffer();
00066             }
00067             Broadcast(buf, root);
00068             if (buf && buf->Valid())
00069             {
00070                 //f = new Feature::FeatureTable(featureDef);
00071                 Read(res, buf);
00072                 delete buf;
00073             }
00074             else
00075             {
00076                 ILOG_ERROR(myId << ": could not read file from buffer");
00077             }
00078             Link::Mpi::Barrier();
00079         }
00080         return res;
00081     }

Here is the call graph for this function:


Generated on Thu Jan 13 09:22:46 2011 for ImpalaSrc by  doxygen 1.5.1