From: Kirill Shcherbatov <kshcherbatov@tarantool.org> To: tarantool-patches@freelists.org, Mergen Imeev <imeevma@tarantool.org> Subject: [tarantool-patches] Re: [PATCH v2 3/7] box: create new methods for ephemeral spaces Date: Wed, 18 Jul 2018 14:52:52 +0300 [thread overview] Message-ID: <b55637af-fc97-4ce9-8111-fcfb5c328383@tarantool.org> (raw) In-Reply-To: <d6efda7558f2df66ef79e44627e8bcfb9e4b3a7e.1531837331.git.imeevma@gmail.com> > /** > + * Fill up request according to given > + * operation type. For all cases but > + * UPSERT argument name match names of > + * fields of struct request. For UPSERT > + * arguments key and key_end are fields > + * ops and ops_end. > + */ 1. Please, write doxygen-style comment with right margin 66. The other nitpicks are similar: you should be at least consistent with functions comments: I mean, memtx_space_ephemeral_replace has _invalid_ comment, but at the same time memtx_space_execute_upsert doesn't have comment at all. Please, clean-up this by your own. > +memtx_space_ephemeral_replace(struct space *space, struct txn *txn, > + struct request *request, struct tuple **result) > { > - struct memtx_space *memtx_space = (struct memtx_space *)space; > - struct tuple *new_tuple = memtx_tuple_new(space->format, tuple, > - tuple_end); > - if (new_tuple == NULL) > - return -1; > - tuple_ref(new_tuple); > + assert(txn == NULL); > + (void)txn; > + struct tuple *new_tuple = NULL; > struct tuple *old_tuple = NULL; > - if (memtx_space->replace(space, old_tuple, new_tuple, > - DUP_REPLACE_OR_INSERT, &old_tuple) != 0) { > + int rc = memtx_space_replace_impl(space, request, &new_tuple, > + &old_tuple, result); > + if (rc && new_tuple != NULL) 2. rc != 0 3. Looks like you introduce interesting functional changes. They deserve to be tested, don't you think? Or there is no way to test this new API yet? I don't insist on C-module tests if this the only way to test it.
prev parent reply other threads:[~2018-07-18 11:52 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <cover.1531837331.git.imeevma@gmail.com> 2018-07-17 14:55 ` [tarantool-patches] " imeevma 2018-07-18 8:06 ` [tarantool-patches] " Vladislav Shpilevoy 2018-07-18 11:52 ` Kirill Shcherbatov [this message]
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=b55637af-fc97-4ce9-8111-fcfb5c328383@tarantool.org \ --to=kshcherbatov@tarantool.org \ --cc=imeevma@tarantool.org \ --cc=tarantool-patches@freelists.org \ --subject='[tarantool-patches] Re: [PATCH v2 3/7] box: create new methods for ephemeral spaces' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox