53 #define NCBI_USE_ERRCODE_X ObjMgr_BlobSplit
65 return const_cast<C&
>(c);
76 if (
impl.Split(entry) ) {
111 size_t total_size = 0;
157 if ( it->second.size() <= 1 ) {
158 single_ref += it->second.m_Size;
161 NcbiCout <<
"@" << it->first.AsString() <<
": " <<
162 it->second.m_Size <<
'\n';
167 NcbiCout <<
"with 1 obj: " << single_ref <<
'\n';
177 if (
info.m_Descr ) {
201 size_t max_size =
info.m_Name.IsNamed()? 5000: 500;
202 size_t size =
info.m_Size.GetAsnSize();
203 bool add_as_whole =
size <= max_size;
204 if ( add_as_whole ) {
224 switch ( desc.
Which() ) {
244 size_t size =
info.m_Size.GetZipSize();
245 bool add_as_whole =
size <= max_size;
246 bool have_skeleton_priority =
false;
247 bool have_other_priority =
false;
250 have_skeleton_priority =
true;
253 have_other_priority =
true;
256 if ( have_skeleton_priority && have_other_priority ) {
257 add_as_whole =
false;
259 if ( add_as_whole ) {
266 TSeqPos seq_length =
info.m_Location.begin()->second.
267 GetTotalRange().GetLength();
271 descr_piece->
Set().push_back(desc);
274 info.m_SubPieces.push_back(piece_info);
347 NcbiCout <<
"Chunk: " << it->first <<
": " << it->second.m_Size <<
360 size_t zip_size = it->second.m_Size.GetZipSize();
370 if ( sizes.empty() ) {
375 TSizes::iterator small = sizes.begin();
376 while ( small->second <= chunk_it->first ) {
383 small = sizes.begin();
395 LOG_POST_X(7,
" merging chunk " << small->second
396 <<
" into " << chunk_it->first
397 <<
" new size: " << new_size);
402 if ( sizes.empty() ) {
410 <<
i->second <<
", size: " <<
i->first);
422 while ( !pieces.
empty() ) {
425 if ( !objs.
empty() ) {
426 while ( !objs.
empty() ) {
428 main_chunk.
Add(piece);
433 _ASSERT(max_iter->second.empty());
434 pieces.
erase(max_iter);
446 while ( !pieces.
empty() ) {
451 if ( it->second.m_Size > max_size ) {
453 max_size = it->second.m_Size;
463 LOG_POST_X(9,
"Splitting @"<<max_iter->first.AsString()<<
468 bool sequential =
true;
473 if (
range.Empty() ) {
476 if ( !prevRange.
Empty() ) {
478 (
range.IntersectingWith(prevRange) &&
479 range != prevRange) ) {
498 size_t chunk_length = whole_length / chunk_count;
500 size_t max_piece_length = chunk_length / 2;
503 vector<SAnnotPiece> pcs;
508 pcs.push_back(piece);
515 if ( !pcs.empty() ) {
519 " CC:"<<chunk_count<<
520 " WL:"<<whole_length<<
521 " CL:"<<chunk_length<<
522 " ML:"<<max_piece_length);
524 ITERATE ( vector<SAnnotPiece>, it, pcs ) {
527 long_chunk->
Add(piece);
534 vector<SAnnotPiece> pcs;
538 ITERATE ( vector<SAnnotPiece>, it, pcs ) {
545 _ASSERT(max_iter->second.empty());
546 pieces.
erase(max_iter);
550 while ( !pieces.
empty() ) {
553 if ( !objs.
empty() ) {
555 while ( !objs.
empty() ) {
562 _ASSERT(max_iter->second.empty());
563 pieces.
erase(max_iter);
TAnnotPriority GetSeqdescPriority(const CSeqdesc &desc)
NCBI_DEFINE_ERR_SUBCODE_X(12)
void Remove(const SAnnotPiece &piece)
const_iterator begin(void) const
TPiecesById::iterator iterator
SChunkInfo * NextChunk(void)
void AddToSkeleton(CAnnotPieces &pieces)
bool Split(const CSeq_entry &entry)
CRef< CSeq_entry > m_Skeleton
vector< CRef< CAnnotPieces > > TPieces
void MakeID2SObjects(void)
void CopySkeleton(CSeq_entry &dst, const CSeq_entry &src)
void Add(const SAnnotPiece &piece)
bool Split(const CSeq_entry &entry)
vector< CBioseq_SplitInfo > TBioseqs
vector< CRef< CLocObjects_SplitInfo > > TObjects
TAnnotPriority m_Priority
@Seq_descr.hpp User-defined methods of the data storage class.
vector< CSeq_data_SplitInfo > TSeq_data
size_t GetCount(void) const
TDataSize GetZipSize(void) const
TDataSize GetAsnSize(void) const
const_iterator end() const
const_iterator find(const key_type &key) const
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
#define LOG_POST_X(err_subcode, message)
static CRef< CObjectManager > GetInstance(void)
Return the existing object manager or create one.
CSeq_entry_Handle AddTopLevelSeqEntry(CSeq_entry &top_entry, TPriority pri=kPriority_Default, EExist action=eExist_Default)
Add seq_entry, default priority is higher than for defaults or loaders Add object to the score with p...
position_type GetLength(void) const
static TThisType GetEmpty(void)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define BEGIN_SCOPE(ns)
Define a new scope.
TFrom GetFrom(void) const
Get the From member data.
list< CRef< CSeqdesc > > Tdata
E_Choice Which(void) const
Which variant is currently selected.
Tdata & Set(void)
Assign a value to data member.
@ e_User
user defined object
@ e_Pub
a reference to the publication
@ e_Comment
a more extensive comment
@ e_Molinfo
info on the molecule and techniques
@ e_Title
a title for this sequence
@ e_Source
source of materials, includes Org-ref
unsigned int
A callback function used to compare two keys in a database.
Definition of all error codes used in objmgr libraries (xobjmgr.lib, xobjutil.lib and others).
range(_Ty, _Ty) -> range< _Ty >
double value_type
The numeric datatype used by the parser.
const struct ncbi::grid::netcache::search::fields::SIZE size
@ eAnnotPriority_skeleton
TAnnotPriority m_Priority
void Add(const SChunkInfo &info)
const_iterator begin(void) const