Ejemplo n.º 1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (ProjectId.Length != 0)
            {
                hash ^= ProjectId.GetHashCode();
            }
            if (IndexId.Length != 0)
            {
                hash ^= IndexId.GetHashCode();
            }
            if (Kind.Length != 0)
            {
                hash ^= Kind.GetHashCode();
            }
            if (Ancestor != global::Google.Cloud.Datastore.Admin.V1.Index.Types.AncestorMode.Unspecified)
            {
                hash ^= Ancestor.GetHashCode();
            }
            hash ^= properties_.GetHashCode();
            if (State != global::Google.Cloud.Datastore.Admin.V1.Index.Types.State.Unspecified)
            {
                hash ^= State.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Ejemplo n.º 2
0
        private static void AddFailedItemsToCollection(IFailedItemStorage store, Guid mailboxGuid, long referenceDocId, int pageSize, List <NonIndexableItem> nonIndexableItems)
        {
            FailedItemParameters parameters = new FailedItemParameters(FailureMode.All, FieldSet.Default)
            {
                MailboxGuid     = new Guid?(mailboxGuid),
                StartingIndexId = referenceDocId,
                ResultLimit     = pageSize
            };

            foreach (IFailureEntry failureEntry in store.GetFailedItems(parameters))
            {
                MdbItemIdentity mdbItemIdentity = (MdbItemIdentity)failureEntry.ItemId;
                nonIndexableItems.Add(new NonIndexableItem
                {
                    CompositeId        = mdbItemIdentity,
                    ErrorCode          = NonIndexableItem.ConvertSearchErrorCode(failureEntry.ErrorCode),
                    ErrorDescription   = failureEntry.ErrorDescription.ToString(),
                    IsPartiallyIndexed = failureEntry.IsPartiallyIndexed,
                    IsPermanentFailure = failureEntry.IsPermanentFailure,
                    AttemptCount       = failureEntry.AttemptCount,
                    LastAttemptTime    = failureEntry.LastAttemptTime,
                    AdditionalInfo     = failureEntry.AdditionalInfo,
                    SortValue          = IndexId.CreateIndexId(mdbItemIdentity.MailboxNumber, mdbItemIdentity.DocumentId).ToString()
                });
            }
        }
Ejemplo n.º 3
0
 public Area()
 {
     Color = Color.Black;
     Index = new IndexId();
     Low   = 0;
     Hight = 0;
     Name  = "";
 }
Ejemplo n.º 4
0
 public ColorMountains()
 {
     List               = new List <MountainsCircle>();
     ModeAutomatic      = false;
     Color              = Color.Black;
     IndexGroupTop      = new IndexId();
     ColorMountain      = Color.Black;
     IndexMountainGroup = new IndexId();
     Name               = "";
 }
Ejemplo n.º 5
0
        private string GetQuery( )
        {
            string cmdText = "";

            switch (cmbOperation.SelectedIndex)
            {
            case 0:
                cmdText = "DBCC SHOWCONTIG(" + ObjectId + ", " + IndexId.ToString() + ") WITH TABLERESULTS";
                break;

            case 1:
                cmdText = "DBCC CHECKTABLE('" + Utils.ReplaceQuatations(ObjectOwner + "." + ObjectName) + "', " + IndexId.ToString() + ") WITH TABLERESULTS";
                break;

            case 2:
                if (rbUseOriginal.Checked)
                {
                    cmdText = "DBCC DBREINDEX('" + Utils.ReplaceQuatations(ObjectOwner + "." + ObjectName) + "', '" + Utils.ReplaceQuatations(IndexName) + "')";
                }
                else if (rbReset.Checked)
                {
                    cmdText = "DBCC DBREINDEX('" + Utils.ReplaceQuatations(ObjectOwner + "." + ObjectName) + "', '" + Utils.ReplaceQuatations(IndexName) + "', " + maskedTextBox1.Text + ")";
                }
                break;

            case 3:
                cmdText = "DBCC SHOW_STATISTICS('" + Utils.ReplaceQuatations(ObjectOwner + "." + ObjectName) + "', " + Utils.Qualify(IndexName) + ")";
                break;

            case 4:

                string _command = "DBCC UPDATEUSAGE(0, '" + Utils.ReplaceQuatations(ObjectOwner + "." + ObjectName) + "', " + IndexId.ToString() + ")";
                if (chkWithCountRows.Checked)
                {
                    _command += " WITH COUNT_ROWS";
                }
                cmdText = _command;

                break;
            }
            return(cmdText);
        }
Ejemplo n.º 6
0
 public override string ToString()
 {
     return(string.Format("Index: {0}, LastIndexedEtag: {1}", Index == null ? IndexId.ToString() : Index.PublicName, LastIndexedEtag));
 }
Ejemplo n.º 7
0
        public SearchMailboxesResults Search(ISearchPolicy policy, SearchMailboxesInputs input)
        {
            long                     num        = 0L;
            long                     num2       = 0L;
            long                     num3       = 0L;
            long                     num4       = 0L;
            long                     num5       = 0L;
            long                     num6       = 0L;
            ulong                    num7       = 0UL;
            SortedResultPage         resultPage = null;
            MultiMailboxSearchClient multiMailboxSearchClient = null;
            ResultAggregator         resultAggregator         = new ResultAggregator();
            ByteQuantifiedSize       byteQuantifiedSize       = new ByteQuantifiedSize(0UL);
            List <MailboxStatistics> list = new List <MailboxStatistics>();
            Dictionary <Guid, List <KeyValuePair <int, long> > > dictionary = new Dictionary <Guid, List <KeyValuePair <int, long> > >();
            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();
            Recorder.Record record = policy.Recorder.Start("SearchResultProvider", TraceType.InfoTrace, true);
            Recorder.Trace(5L, TraceType.InfoTrace, new object[]
            {
                "FastLocalSearchResultsProvider.Search Input:",
                input,
                "Type:",
                input.SearchType
            });
            SearchMailboxesResults result;

            try
            {
                Recorder.Trace(5L, TraceType.InfoTrace, "FastLocalSearchResultsProvider.Search Initializing");
                num3 = stopwatch.ElapsedMilliseconds;
                string str  = (input.PagingInfo != null && input.PagingInfo.SortBy != null && input.PagingInfo.SortBy.SortOrder == SortOrder.Ascending) ? "+" : "-";
                string str2 = (input.PagingInfo != null && input.PagingInfo.SortValue != null && input.PagingInfo.SortValue.SortColumn == ItemSchema.DocumentId) ? "[docid]" : FastIndexSystemSchema.Received.Name;
                AdditionalParameters additionalParameters = new AdditionalParameters
                {
                    Sort     = str + str2,
                    Refiners = new string[]
                    {
                        FastIndexSystemSchema.Size.Name
                    }
                };
                long referenceDocId = 0L;
                PaginationQueryFilter pagingFilter = null;
                QueryFilter           queryFilter  = input.Criteria.Query;
                if (input.PagingInfo != null && input.PagingInfo.SortValue != null)
                {
                    referenceDocId = input.PagingInfo.SortValue.SecondarySortValue;
                    if (input.PagingInfo.SortValue.SortColumnValue != null && input.PagingInfo.SortValue.SortColumn != ItemSchema.DocumentId)
                    {
                        pagingFilter = new PaginationQueryFilter(input.PagingInfo);
                    }
                }
                SearchSource searchSource = input.Sources.FirstOrDefault <SearchSource>();
                if (searchSource != null)
                {
                    Guid   guid        = searchSource.MailboxInfo.IsArchive ? searchSource.MailboxInfo.ArchiveDatabase : searchSource.MailboxInfo.MdbGuid;
                    string displayName = FlowDescriptor.GetImsFlowDescriptor(FastLocalSearchResultsProvider.SearchConfig, FastIndexVersion.GetIndexSystemName(guid)).DisplayName;
                    num4 += stopwatch.ElapsedMilliseconds - num3;
                    num3  = stopwatch.ElapsedMilliseconds;
                    Recorder.Trace(5L, TraceType.InfoTrace, new object[]
                    {
                        "FastLocalSearchResultsProvider.Search Initialized DB:",
                        guid,
                        "Flow:",
                        displayName
                    });
                    List <SearchSource> list2 = new List <SearchSource>(input.Sources);
                    while (list2.Count > 0)
                    {
                        HashSet <Guid>      hashSet = new HashSet <Guid>();
                        List <SearchSource> list3   = new List <SearchSource>();
                        int i = 0;
                        while (i < list2.Count)
                        {
                            SearchSource searchSource2 = list2[i];
                            Guid         item          = searchSource2.MailboxInfo.IsArchive ? searchSource2.MailboxInfo.ArchiveGuid : searchSource2.MailboxInfo.MailboxGuid;
                            if (!hashSet.Contains(item))
                            {
                                list3.Add(searchSource2);
                                list2.RemoveAt(i);
                                hashSet.Add(item);
                            }
                            else
                            {
                                i++;
                            }
                        }
                        multiMailboxSearchClient = new MultiMailboxSearchClient(guid, (from s in list3
                                                                                       select s.MailboxInfo).ToArray <MailboxInfo>(), input.Criteria, input.CallerInfo, input.PagingInfo);
                        foreach (SearchSource searchSource3 in list3)
                        {
                            Recorder.Trace(5L, TraceType.InfoTrace, "FastLocalSearchResultsProvider.Search Searching Source", searchSource3);
                            ulong              num8 = 0UL;
                            bool               flag = false;
                            MailboxStatistics  mailboxStatistics   = null;
                            ByteQuantifiedSize byteQuantifiedSize2 = new ByteQuantifiedSize(0UL);
                            List <KeyValuePair <int, long> > list4 = new List <KeyValuePair <int, long> >();
                            Guid guid2 = searchSource3.MailboxInfo.IsArchive ? searchSource3.MailboxInfo.ArchiveGuid : searchSource3.MailboxInfo.MailboxGuid;
                            queryFilter = this.ApplyFolderFilter(queryFilter, searchSource3.MailboxInfo, multiMailboxSearchClient);
                            string text = FqlQueryBuilder.ToFqlString(queryFilter, input.Criteria.QueryCulture);
                            text = this.ApplyPagingFilter(text, referenceDocId, pagingFilter, input.PagingInfo, input.Criteria.QueryCulture);
                            Recorder.Trace(5L, TraceType.InfoTrace, new object[]
                            {
                                "FastLocalSearchResultsProvider.Search Searching Source Guid:",
                                guid2,
                                "Filter:",
                                queryFilter,
                                "Query:",
                                text
                            });
                            num6 += stopwatch.ElapsedMilliseconds - num3;
                            num3  = stopwatch.ElapsedMilliseconds;
                            IEnumerable <KeyValuePair <PagingImsFlowExecutor.QueryExecutionContext, SearchResultItem[]> > enumerable = FastLocalSearchResultsProvider.FlowExecutor.Execute(displayName, guid2, policy.CallerInfo.QueryCorrelationId, text, 0L, input.Criteria.QueryCulture, additionalParameters, Math.Min(FastLocalSearchResultsProvider.SearchConfig.FastQueryResultTrimHits, input.PagingInfo.PageSize), null);
                            foreach (KeyValuePair <PagingImsFlowExecutor.QueryExecutionContext, SearchResultItem[]> keyValuePair in enumerable)
                            {
                                Recorder.Trace(5L, TraceType.InfoTrace, "FastLocalSearchResultsProvider.Search found pages");
                                PagingImsFlowExecutor.QueryExecutionContext key = keyValuePair.Key;
                                ISearchResultItem[] value = keyValuePair.Value;
                                if (!flag)
                                {
                                    Recorder.Trace(5L, TraceType.InfoTrace, "FastLocalSearchResultsProvider.Search found statistics");
                                    num8 += (ulong)FastLocalSearchResultsProvider.FlowExecutor.ReadHitCount(key);
                                    IEnumerable <RefinerResult> source = FastLocalSearchResultsProvider.FlowExecutor.ReadRefiners(key);
                                    RefinerResult refinerResult        = source.FirstOrDefault((RefinerResult t) => t.Name == FastIndexSystemSchema.Size.Name);
                                    if (refinerResult != null)
                                    {
                                        byteQuantifiedSize2 += new ByteQuantifiedSize((ulong)refinerResult.Sum);
                                    }
                                    mailboxStatistics = new MailboxStatistics(searchSource3.MailboxInfo, num8, byteQuantifiedSize2);
                                    flag = true;
                                }
                                foreach (ISearchResultItem searchResultItem in value)
                                {
                                    Recorder.Trace(5L, TraceType.InfoTrace, "FastLocalSearchResultsProvider.Search found items");
                                    IFieldHolder fieldHolder = searchResultItem.Fields.FirstOrDefault((IFieldHolder f) => string.Equals(f.Name, "DocId", StringComparison.InvariantCultureIgnoreCase));
                                    if (fieldHolder != null)
                                    {
                                        long num9       = (long)fieldHolder.Value;
                                        int  documentId = IndexId.GetDocumentId(num9);
                                        IndexId.GetMailboxNumber(num9);
                                        list4.Add(new KeyValuePair <int, long>(documentId, num9));
                                    }
                                }
                                if (list4.Count >= input.PagingInfo.PageSize)
                                {
                                    Recorder.Trace(5L, TraceType.InfoTrace, "FastLocalSearchResultsProvider.Search completed FAST");
                                    break;
                                }
                            }
                            num7 += num8;
                            byteQuantifiedSize += byteQuantifiedSize2;
                            if (list4.Count > 0)
                            {
                                dictionary[guid2] = list4;
                            }
                            if (mailboxStatistics != null)
                            {
                                list.Add(mailboxStatistics);
                            }
                            num += stopwatch.ElapsedMilliseconds - num3;
                            num3 = stopwatch.ElapsedMilliseconds;
                        }
                        if (dictionary.Count > 0)
                        {
                            Recorder.Trace(5L, TraceType.InfoTrace, "FastLocalSearchResultsProvider.Search loading preview items");
                            resultPage = multiMailboxSearchClient.FetchPreviewProperties(dictionary);
                            num2      += stopwatch.ElapsedMilliseconds - num3;
                            num3       = stopwatch.ElapsedMilliseconds;
                        }
                        Recorder.Trace(5L, TraceType.InfoTrace, "FastLocalSearchResultsProvider.Search aggregating");
                        ISearchResult aggregator = new AggregatedSearchTaskResult(new MailboxInfoList(multiMailboxSearchClient.Mailboxes), resultPage, null, num7, byteQuantifiedSize, null, list, null);
                        resultAggregator.MergeSearchResult(aggregator);
                        num5 += stopwatch.ElapsedMilliseconds - num3;
                        num3  = stopwatch.ElapsedMilliseconds;
                    }
                }
                result = new SearchMailboxesResults(input.Sources)
                {
                    SearchResult = resultAggregator
                };
            }
            finally
            {
                record.Attributes["FAST"]      = num;
                record.Attributes["STORE"]     = num2;
                record.Attributes["REST"]      = num6;
                record.Attributes["INIT"]      = num4;
                record.Attributes["AGGR"]      = num5;
                record.Attributes["TOTALSIZE"] = byteQuantifiedSize;
                record.Attributes["TOTALCNT"]  = num7;
                policy.Recorder.End(record);
            }
            return(result);
        }
Ejemplo n.º 8
0
 public Textures()
 {
     Index = new IndexId();
     List  = new List <TextureID>();
     Name  = "";
 }