I'm using HBase 0.98.
In the hbase-site.xml I didn't set the split policy nor the max file size for the regions. The default values are used: 10GiB (10737418240) for the MAX_FILESIZE attribute and IncreasingToUpperBoundRegionSplitPolicy for the SPLIT_POLICY.
When writing a table, all this make sense. I write the original table without any configuration. I just created it with:
create 'raw', 'c1'
When the dump was finished the regions were these:
310 /user/hadoop/hbase-datastore/data/default/raw/.tabledesc
0 /user/hadoop/hbase-datastore/data/default/raw/.tmp
3.4 G /user/hadoop/hbase-datastore/data/default/raw/0af75fec94d251fcb576059caad679d3
505.5 M /user/hadoop/hbase-datastore/data/default/raw/2713fccb2da4d0fcadc9c57bb23dc388
505.5 M /user/hadoop/hbase-datastore/data/default/raw/4b413063bc1f31d475129ce5abd730d2
115.4 M /user/hadoop/hbase-datastore/data/default/raw/b7ee08d6d7540b2b1bdf98c67c00cd77
973.5 M /user/hadoop/hbase-datastore/data/default/raw/bfcd8222b95814893516c358e8d97a1f
After that, I decided to dump the whole table in other table in order to get around 8 regions.
I created a table through hbase shell with this command:
create '8reg', {METHOD => 'table_att', CONFIGURATION => {MAX_FILESIZE => '738197504', 'SPLIT_POLICY' => 'org.apache.hadoop.hbase.regionserver.ConstantSizeRegionSplitPolicy'}}, {NAME => 'c1'}
So the MAX_FILESIZE attribute is overriden with 704MiB and the SPLIT_POLICY with ConstantSizeRegionSplitPolicy. However, when writting the new table, the behavior is similar. I don't get anything similar to what I expected. Some regions exceed the MAX_FILESIZE. It seems that HBase is using again the default configuration (10GiB and IncreasingToUpperBoundRegionSplitPolicy):
393 /user/hadoop/hbase-datastore/data/default/8reg/.tabledesc
0 /user/hadoop/hbase-datastore/data/default/8reg/.tmp
692.2 M /user/hadoop/hbase-datastore/data/default/8reg/4bf7246cc65dfa63f2f8d9773f49fb56
3.7 G /user/hadoop/hbase-datastore/data/default/8reg/67ed89ae43a31a78284514c925109826
1023.4 M /user/hadoop/hbase-datastore/data/default/8reg/904224f3a5c5f427f5fe22665fb16a29
68.0 M /user/hadoop/hbase-datastore/data/default/8reg/d2c36e9e9a35665add3b13265d80ae09
The description of the original table is:
DESCRIPTION ENABLED 'raw', {TABLE_ATTRIBUTES => {MAX_FILESIZE => ' true 10737418240'}, {NAME => 'c1', DATA_BLOCK_ENCOD ING => 'NONE', BLOOMFILTER => 'ROW', REPLICATI ON_SCOPE => '0', VERSIONS => '1', COMPRESSION => 'NONE', MIN_VERSIONS => '0', TTL => 'FOREVE R', KEEP_DELETED_CELLS => 'false', BLOCKSIZE = > '65536', IN_MEMORY => 'false', BLOCKCACHE => 'true'} 1 row(s) in 1.6670 seconds
The description of the configured table is:
DESCRIPTION ENABLED '8reg', {CONFIGURATION => {'SPLIT_POLICY' => ' true org.apache.hadoop.hbase.regionserver.ConstantSizeRegionSplitPolicy', 'MAX_FILESIZE' => '7381 97504'}}, {NAME => 'c1', DATA_BLOCK_ENCODING = > 'NONE', BLOOMFILTER => 'ROW', REPLICATION_SC OPE => '0', VERSIONS => '1', COMPRESSION => 'N ONE', MIN_VERSIONS => '0', TTL => 'FOREVER', K EEP_DELETED_CELLS => 'false', BLOCKSIZE => '65 536', IN_MEMORY => 'false', BLOCKCACHE => 'true'} 1 row(s) in 1.6890 seconds
Thank you so much.
Related
I'm using TYPO3. I programmed an extension called 'Eventmanager', to manage events.
After installing this extension, in Backend I can add/edit event-records. With each record there is a field called end_time, which is a datetime-picker, for choosing the date and time of the events.
Today I edit an event-record. I deleted the value of this end_time field (to make it empty), and tried to save this record. But an error occurred during saving:
2: SQL error: 'Incorrect integer value: '' for column 'event_end_time' at row 1' (tx_eventmanager_domain_model_event:13)
The Settings in TCA is shown as follows:
'endtime' => array(
'exclude' => 1,
'l10n_mode' => 'mergeIfNotBlank',
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.endtime',
'config' => array(
'type' => 'input',
'size' => 13,
'max' => 20,
'eval' => 'datetime',
'checkbox' => 0,
'default' => 0,
'range' => array(
'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))
),
),
),
and the definition in the file 'ext_tables.sql' is shown as follows:
event_end_time int(11) DEFAULT '0' NOT NULL
Can someone tell my what is the reason? How can I solve this problem?
I use getUserPhotos to get profile photos. What is the main standard source that I should use for html src attribute? (I searched even in telegram's docs, but didn't get the solution.)
A part of my result (type is photos.Photos):
Array
(
[_] => photos.photosSlice
[count] => 14
[photos] => Array
(
[0] => Array
(
[_] => photo
[has_stickers] =>
[id] => 195744071274310414
[access_hash] => -5116812755800708610
[date] => 1472714208
[sizes] => Array
(
[0] => Array
(
[_] => photoSize
[type] => a
[location] => Array
(
[_] => fileLocation
[dc_id] => 4
[volume_id] => 425426808
[local_id] => 100105
[secret] => -7781982930425156181
)
[w] => 160
[h] => 160
[size] => 11694
)
...
What you need to do is use the following method to download your file or picture:
upload.getFile#e3a6cfb5 location:InputFileLocation offset:int limit:int = upload.File;
Where InputFileLocation is defined below, and may be obtained from PhotoSize.location in your question above:
inputFileLocation#14637196 volume_id:long local_id:int secret:long = InputFileLocation;
more details on file download here: https://core.telegram.org/api/files#downloading-files
Its a parent child relation,
In childGroup1, getting error during accessing 'PARENT_ID' attribute.
The given error is Trying to get property of non-object.
I am having access dynamically.
How to get PARENT_ID in such case.
return array(
'group1'=>array(
'ID' => 1,
'NAME' => 'Test',
'STATUS' => 1,
),
'childGroup1'=>array(
'ID' => 2,
'PARENT_ID' => $this->getRecord('groups','group1')->ID,
'NAME' => 'Child Test group1',
'STATUS' => 1,
),
);
Since the records are not loaded yet, you cannot use $this->getRecord() to acquire a record. As such, just use plain old array logic to get the record's ID.
$records = array();
$records['group1'] = array(
'ID' => 1,
'NAME' => 'Test',
'STATUS' => 1,
);
$records['childGroup1'] = array(
'ID' => 2,
'PARENT_ID' => $records['group1']['ID'],
'NAME' => 'Child Test group1',
'STATUS' => 1,
);
return $records;
If you need records from other fixtures, just require them.
$groups = require __DIR__.'/group.php';
This, of course, would be what you put at the top of files OTHER than groups.php, in order to gain access to the groups models.
Hello I am using bootstrap.widgets.TbSelect2 in Yii.
You can see this link to check my form.
https://www.diigo.com/item/p/qoaqepdzbsbbaqeqdzbcbrsdpa/bc91ebd999371bef68737b8320afed91
How to add the data in TbSelect2?
thank you.
its so simple , just generate an array for this
$this->widget('bootstrap.widgets.TbSelect2', array(
'asDropDownList' => true,
'name' => 'status',
'data' => array( // свои значения для option
'active' => 'Active',
'pending' => 'Pending',
'invited' => 'Invited',
'deleted' => 'Deleted'
),
)
);
I need to create a new configurable product via Magento Soap API and add a related product to it.
I use this code that create 2 products ( one simple and one configur. ) then i try to link the simple one to the config one...this don't work..
There is a tutorial for do that??
Any help??
Many thanks.
// Magento login information
$mage_url = 'http://test.de/api/?wsdl';
$mage_user = 'admin';
$mage_api_key = 'admin';
// Initialize the SOAP client
$soap = new SoapClient( $mage_url );
// Login to Magento
$session = $soap->login( $mage_user, $mage_api_key );
$attributeSets = $soap->call($session,'product_attribute_set.list');
$set = current($attributeSets);
$sku = 'iphone-12345';
//configurable
$newProductData = array(
'name' => 'iPhone',
'websites' => array(1),
'short_description' => 'short description',
'description' => 'description',
'price' => 150,
'status' => '1',
'categories' => array(138),
);
$newProductRelated = array(
'name' => 'iPhone',
'websites' => array(1),
'short_description' => 'short description',
'description' => 'description',
'price' => 150,
'status' => '1',
'sku' => '2551464'
);
$productId = $soap->call($session,'product.create',array('configurable', $set['set_id'], $sku ,$newProductData));
$productId2 = $soap->call($session,'product.create',array('simple', $set['set_id'], $newProductRelated['sku'] ,$newProductRelated));
$soap->call($session, 'product_link.assign', array('configurable', $sku, $newProductRelated['sku'], array('position'=>0, 'colore'=> 21, 'qty'=>6)));
mant thx again.
Dealing with a similar issue and resorted to using the CSV import to create the relation for products imported from the API. This may may be a usable approach for a one time import via a generated CSV.