IRubricatorFactorExecutor.UseDwarf

Fore Syntax

UseDwarf: Boolean;

Fore.NET Syntax

UseDwarf: boolean;

Description

The UseDwarf property determines whether to use optimization when the time series database data is loaded to memory.

Comments

Available values:

Fore Example

Executing the example requires that the repository contains a time series database with the FC identifier. This database must contain an attribute of the time series with the COUNTRY identifier that refers to a dictionary.

Add links to the Metabase, Cubes, Matix, Rds, Orm system assemblies.

Sub uProc;
Var
    MB: IMetabase;
    RubDesc: IMetabaseObjectDescriptor;
    RubrIn: IRubricatorInstance;
    Cub: ICubeInstance;
    Dest: ICubeInstanceDestination;
    FactorExec: IRubricatorFactorExecutor;
    FactsLookup: IRubricatorFactsLookup;
    MetaDLookup: IMetaDictionaryLookup;
    Key: Array Of Integer;
    i: Integer;
    Cond: IOrmCondition;
    Exec: ICubeInstanceDestinationExecutor;
    Mat: IMatrix;
    Ite: IMatrixIterator;
Begin
    MB := MetabaseClass.Active;
    RubDesc := MB.ItemById("FC");
    RubrIn := RubDesc.Open(NullAs IRubricatorInstance;
    Cub := RubrIn As ICubeInstance;
    Dest := Cub.Destinations.DefaultDestination;
    Exec := Dest.CreateExecutor;
    FactorExec := Exec As IRubricatorFactorExecutor;
    FactorExec.MultipleFactors := True;
    FactsLookup := RubrIn.CreateFactsLookup;
    MetaDLookup := FactsLookup.Lookup;
    Cond := MetaDLookup.Where.Add;
    Cond.AttributeName := "COUNTRY";
    Cond.Value := 512;
    i := FactsLookup.LookupFactors.Length;
    Key := New Integer[i];
    Key := FactsLookup.LookupFactors;
    FactorExec.SetFactorKeys(Key);
    FactorExec.ValueKind := MetaAttributeKind.Value;
    FactorExec.ValueId := "VL";
    FactorExec.WhereRevisionBetween(11);
    FactorExec.UseDwarf := True;
    Exec := FactorExec.AsCubeExecutor;
    Exec.PrepareExecute(Null);
    Exec.PerformExecute;
    Mat := Exec.Matrix;
    Ite := Mat.CreateIterator;
    Ite.Move(IteratorDirection.First);
    While Ite.Valid Do
        Debug.WriteLine(Ite.Value);
        Ite.Move(IteratorDirection.Next);
    End While;
End Sub uProc;

After executing the example the console window displays values of time series for the first revision that correspond to the condition: value of the COUNTRIES attribute is 512. The optimization is used when data is obtained.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Matrix;
Imports Prognoz.Platform.Interop.Orm;
Imports Prognoz.Platform.Interop.Rds;
Imports Prognoz.Platform.Interop.ForeSystem;

[STAThread]
Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    RubDesc: IMetabaseObjectDescriptor;
    RubrIn: IRubricatorInstance;
    Cub: ICubeInstance;
    Dest: ICubeInstanceDestination;
    FactorExec: IRubricatorFactorExecutor;
    FactsLookup: IRubricatorFactsLookup;
    MetaDLookup: IMetaDictionaryLookup;
    Key: System.Array;
    i: Integer;
    Cond: IOrmCondition;
    Exec: ICubeInstanceDestinationExecutor;
    Mat: IMatrix;
    Ite: IMatrixIterator;
Begin
    mb := Params.Metabase;
    RubDesc := MB.ItemById["FC"];
    RubrIn := RubDesc.Open(NullAs IRubricatorInstance;
    Cub := RubrIn As ICubeInstance;
    Dest := Cub.Destinations.DefaultDestination;
    Exec := Dest.CreateExecutor();
    FactorExec := Exec As IRubricatorFactorExecutor;
    FactorExec.MultipleFactors := True;
    FactsLookup := RubrIn.CreateFactsLookup();
    MetaDLookup := FactsLookup.Lookup;
    Cond := MetaDLookup.Where.Add();
    Cond.AttributeName := "COUNTRY";
    Cond.Value := 512;
    i := FactsLookup.LookupFactors().Length;
    Key := New Integer[i];
    Key := FactsLookup.LookupFactors();
    FactorExec.SetFactorKeys(Key);
    FactorExec.ValueKind := MetaAttributeKind.meakValue;
    FactorExec.ValueId := "VL";
    FactorExec.WhereRevisionBetween(11);
    FactorExec.UseDwarf := True;
    Exec := FactorExec.AsCubeExecutor();
    Exec.PrepareExecute(Null);
    Exec.PerformExecute(False);
    Mat := Exec.Matrix;
    Ite := Mat.CreateIterator();
    Ite.Move(IteratorDirection.itdFirst);
    While Ite.Valid Do
        System.Diagnostics.Debug.WriteLine(Ite.Value);
        Ite.Move(IteratorDirection.itdNext);
    End While;
End Sub;

See also:

IRubricatorFactorExecutor