Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #51  
Old 08-16-2005, 11:36 PM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

But since templates can already be cached via a hook, why does this system need to deal with that?

Similar modifications could be made to other datastore types, though they would probably have to drop the active checking, although, if you set a product as inactive, it could write to the other datastore methods at that point.

The end user doesnt need a script to add rows to the new table, the product xml file should deal with that bit automatically.
  #52  
Old 08-16-2005, 11:50 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Phrasegroups for Example currently can't be done with Hooks (at least not for Guests).

I don't really get how you would go about implementing this Idea with other Datastore Classes.
Maybe some example Code?
  #53  
Old 08-16-2005, 11:59 PM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Looking at the other classes, it shouldnt make any difference.

The other datastore types (file based or memcached) appear to fetch a datastore item if it doesnt exist in their specific storage mode and add it. Meaning it only needs to be uncached for one page load, then its added.

Im not sure how it deals with updated datastore items. I guess the build_datastore() functions deal with that too.

Didnt think of phrasegroups, but it shouldnt be hard to add phrasegroups either - Take a look at the deletion log table and how it is joined into multiple different types of items that could be deleted (posts, threads, pms)

Add a new column to the new table of type

[sql]
AND _NEWTABLE_.type = 'datastore' / 'phrasegroup'
[/sql]
  #54  
Old 08-17-2005, 12:05 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by merk
The other datastore types (file based or memcached) appear to fetch a datastore item if it doesnt exist in their specific storage mode and add it. Meaning it only needs to be uncached for one page load, then its added.
Right. But how would the Classes determine if an item has to be cached if it's not in $specialtemplates?
That's the important question
  #55  
Old 08-17-2005, 12:28 AM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by KirbyDE
Right. But how would the Classes determine if an item has to be cached if it's not in $specialtemplates?
That's the important question
Hope it doesnt come across as arrogant - but it doesnt matter. (From what I see from something like the Memcached class, all datastore items that have ever been "queried" are added to the Memcached cache, but a single query happens if it doesnt exist, but only the first time).

From what I see, the $specialtemplates variable is only useful if you want to save queries to the database while using the traditional datastore method.

If the item doesnt exist in the memcached/filestore storage, it will be queried. But only once. After it has been queried, it will be added to the relevant storage.

The biggest issue I see is that what happens when the datastore item is updated in the database. I do not see how it will update the item in the other storage methods - I suspect that it gets updated when you call the build_* functions. I havent looked at that area because I use the database method
  #56  
Old 08-17-2005, 09:20 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Seems like you don't understand me, or I don't understand you

Let's say a Hack needs attachmentcache which isn't in $specialtemplates for the Script.
What should the Plugin do in order to get this?
  #57  
Old 08-17-2005, 01:17 PM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by KirbyDE
Seems like you don't understand me, or I don't understand you

Let's say a Hack needs attachmentcache which isn't in $specialtemplates for the Script.
What should the Plugin do in order to get this?
Maybe just a crossed wire

1) The plugin that accesses a hook should do the standard thing it does to access the datastore item. (IIRC, $vbulletin->name) - however, it may need to be unserialized. I dont see an issue with unserializing in global_start.

2) The product should add a row into the NEWTABLE table with relevant details of the datastore item. Name, Product ID, Scripts that the datastore item should be loaded on (THIS_SCRIPT names) and any other details that are needed - havent fully thought of them.

At this point, the datastore class for DB type will query the datastore table joining the new table into it looking for conditions that match to load extra items (or if it exists in $specialtemplates). See query I posted above.

For the other datastore types, (because there are no queries involved for other types) it should be as simple as querying the datastore table once (an extra query for one page load) to load the datastore item into the other types' storage method.

There is an issue with this in that if the datastore item updates in the datastore, the product will have to deal with it gracefully and update the datastore properly, calling the datastore methods that do the magic they do.
  #58  
Old 08-17-2005, 07:56 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by merk
1) The plugin that accesses a hook should do the standard thing it does to access the datastore item. (IIRC, $vbulletin->name) - however, it may need to be unserialized. I dont see an issue with unserializing in global_start.
Well, the Item won't be available as $vbulletin->name if it wasn't in $specialtemplates before calling global.php.
And as Plugins are being loaded out of the Datastore it can't be added through Hooks. That's the whole point of this Thread:
We've got a "Chicken and Egg" Problem here
As I already said, your suggestion works fin - when the default Datastore Class (Database) is being used.
But what's your solution when using other Datastore Classes?


Quote:
For the other datastore types, (because there are no queries involved for other types) it should be as simple as querying the datastore table once (an extra query for one page load) to load the datastore item into the other types' storage method.
Ah, now there we go.
Sure, that would be possible - with the dabwack of having an additional Query for every Pageload.
And that's what the discusssion here is all about: Which approach adds the smallest Overhead possible?

Quote:
There is an issue with this in that if the datastore item updates in the datastore, the product will have to deal with it gracefully and update the datastore properly, calling the datastore methods that do the magic they do.
The Datastore Classes will take care of Updates, that's not a Problem.
  #59  
Old 08-17-2005, 10:23 PM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by KirbyDE
Ah, now there we go.
Sure, that would be possible - with the dabwack of having an additional Query for every Pageload.
And that's what the discusssion here is all about: Which approach adds the smallest Overhead possible?


The Datastore Classes will take care of Updates, that's not a Problem.

<!-- edit: this bit can be ignored, next para solves the solution in my opinion: As far as i can see there will only ever need to be ONE query if the item doesnt exist in the other datastore types' storage. Not fully grasping what happens with them, i suspect thats how it works. (At least thats how it appears to look).

After the single query on the first pageload it is requested on has passed, there will be no more queries. -->

There also wont be any queries if the product builds its datastore item using the class, because the class will deal with the build and will put it into the proper storage.

And as long as the product manages datastore changes properly - it isnt an issue.
  #60  
Old 08-17-2005, 11:22 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by merk
As far as i can see there will only ever need to be ONE query if the item doesnt exist in the other datastore types' storage. Not fully grasping what happens with them, i suspect thats how it works. (At least thats how it appears to look).
How does the Datastore Class (on subsequent Pageloads) know that there are no Entries that need to be cached, and thus does not execute the Query?
How does it know which entries need to be made available as $vbulletin->name?
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:43 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09298 seconds
  • Memory Usage 2,274KB
  • Queries Executed 14 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (8)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete